-
Notifications
You must be signed in to change notification settings - Fork 4k
Connect-AzAccount works through powershell but not when called by C# application running in VS2022 #27374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here are some similar issues that might help you. Please check if they can solve your problem. Possible solution (Extracted from existing issue, might be incorrect; please verify carefully) We are sharing an engineering build of Az.Accounts 2.6.2 https://azposhpreview.blob.core.windows.net/public/Az.Accounts.2.6.2.nupkg. Please download and install it following instruction.
Please let us know whether issue can be eliminated. Your feedback is very important to us. Reference:
Powered by issue-sentinel |
Here are some similar issues that might help you. Please check if they can solve your problem. Possible solution (Extracted from existing issue, might be incorrect; please verify carefully) Solution 1:We are sharing an engineering build of Az.Accounts 2.6.2 https://azposhpreview.blob.core.windows.net/public/Az.Accounts.2.6.2.nupkg. Please download and install it following instruction.
Please let us know whether issue can be eliminated. Your feedback is very important to us. Reference: Solution 2:Az.Accounts 2.6.2 fixed the issue for me - I can successfully use Connect-AzAccount inside Visual Studio Code's PowerShell 5.1 Integrated Console using Az 6.6.0 from PSGallery and Az.Accounts 2.6.2 from LocalPSRepo. Reference: Solution 3:I can confirm that that provided engineering build fixed problem on my machine. Thanks! Reference: Powered by issue-sentinel |
These solutions are for Powershell 5 and Az.Accounts 2.6.2. I'm using Powershell 7 and Az.Accounts 4.0.2 |
An update on this would be great - the above do not resolve the issue, and this is a current blocker for my team |
Bump, encountering the same issue. |
Uh oh!
There was an error while loading. Please reload this page.
Description
I have a windows forms application that we migrated to .NET 9 so that Microsoft.Powershell.SDK will run Powershell 7 instead of Powershell 5 due to issues we were facing with Connect-AzAccount in PowerShell 5. From Powershell 7, I can run Connect-AzAccount with no issue, but when I execute the command vai a PowerShell object in C#, the interactive browser login does not open, and I get a Method not found error for Azure.Identity,InteractiveBrowserCredential.AuthenticateAsync.
I have tried disabling WAM, turning off the V2 Login Experience and connecting using a service account:
Connecting using a service account - this returned an "Entry point not found" error and seems to be using a different API call than when I run it directly in Powershell v7
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: