question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: Uploading Screen Shot 2022-08-09 at 5.34.19 PM.png…

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kevjumbacommented, Aug 10, 2022

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.

0reactions
msftbot[bot]commented, Aug 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found