-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
- Package Name: azure-identity
- Package Version: 1.6.0
- Operating System: MacOS
- Python Version: 3.7.4
Describe the bug
When authenticating using the DefaultAzureCredential in a Jupyter Notebook, it will try several authentication mechanisms as described here, as expected.
But even if one of the authentication methods happen to succeed, you will see the messages for the authentication methods that didn't succeed before the final (successful) authentication method was attempted (which you don't get a success message).
So you may see a message like this, even if the authentication succeeded (in this case via Interactive Browser):
EnvironmentCredential.get_token failed: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
ManagedIdentityCredential.get_token failed: ManagedIdentityCredential authentication unavailable, no managed identity endpoint found.
SharedTokenCacheCredential.get_token failed: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
VisualStudioCodeCredential.get_token failed: Failed to get Azure user details from Visual Studio Code.
AzureCliCredential.get_token failed: Please run 'az login' to set up an account
This is confusing because the user may think that the authentication failed.
Ideally we should not show the failed attempts if one of them succeeded.
Or at least it should display which authentication method succeeded at the end...
To Reproduce
Steps to reproduce the behavior:
- Authenticate with any Azure SDK client that accepts
DefaultAzureCredentialin a Jupyter Notebook - Don't pass environment variables for the
EnvironmentCredentialso that you see at least oneget_token failedmessage even when one of the authentication methods succeeded.
Expected behavior
Don't show failed messages if one of the authentication methods succeeded.
Or show what was attempted but also show what succeeded.
Related issues