CLI authentication
See original GitHub issue- Package Name: azure-cli
- Package Version: 2.39.0
- Operating System: M1 Monterey
- Python Version: 3.10.3
Describe the bug
I can’t authenticate to azure or get the azure credentials. I’ve logged in through vs code and az login
through the cli. I can see my resources under the Azure pulldown in vscode but when I run code, I get
VisualStudioCodeCredential: Failed to get Azure user details from Visual Studio Code.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: PowerShell is not installed
I’m just running this code:
from azure.identity import VisualStudioCodeCredential
from azure.mgmt.resource.resources import ResourceManagementClient
credential = VisualStudioCodeCredential()
client = ResourceManagementClient(
credential=credential,
subscription_id="YOUR_SUBSCRIPTION_ID"
)
To Reproduce Steps to reproduce the behavior: 1.
Expected behavior This isn’t supposed to happen.
Screenshots Azure vscode screenshot verifying that I’m logged in:
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Secure a CLI with Auth0
The three ways to secure a CLI with Auth0, in order of most secure to least secure, are: Device Authorization Flow for when...
Read more >CLI Authentication with Auth0 | Altostra
In this article, we talk about how the Altostra engineering team implemented authentication in our CLI tools using the Auth0 web login interface....
Read more >Token-based Authentication for the CLI - Oracle Help Center
Token-based authentication for the CLI allows customers to authenticate their session interactively, then use the CLI for a single session ...
Read more >Heroku CLI Authentication
Web-based authentication; Email and password; API token; SSH key. The email address and password are used by the heroku command to obtain an...
Read more >Get Started With the Auth0 CLI - Authentication Just Got Easier
The Auth0 CLI is here! It makes it even easier to create applications, test logins, view logs, and so much more! In this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed the issue. You have to do this https://stackoverflow.com/questions/43983718/set-global-path-environment-variable-in-vs-code to update the vscode path.
I was running jupyter notebooks inside of the vscode cli and that was not using the same $PATH variable as the vscode terminal.
Hi @kevjumba, since you haven’t asked that we “
/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.