- Package Name: azure-identity
- Package Version: 1.4.0b3
- Operating System: Windows
- Python Version: 3.7
Describe the bug
On Windows (haven't tried other OSes, but would expect the same), if the Azure CLI client is logged out, then the AzureCliCredential class will raise ClientAuthenticationError, which causes the credential chain to stop. A common need is to include InteractiveBrowserCredential as the final link in a chained credential, and this bug prevents it from being used.
To Reproduce
Steps to reproduce the behavior:
- Use the following credential, which behind the scenes creates a chain:
credential = identity.DefaultAzureCredential(
exclude_shared_token_cache_credential=False,
exclude_visual_studio_code_credential=False,
exclude_cli_credential=False,
exclude_interactive_browser_credential=False
)
- Make sure Visual Studio Code is logged out of Azure and that the Azure CLI is also logged out.
- Use the
credential for some purpose that would cause it to retrieve a token.
Expected behavior
I believe if the AzureCliCredential class were to raise CredentialUnavailableError instead, then the chain would continue.
Additional context
Found in the course of attempting to work around Azure/azure-sdk-for-net#8934.
Describe the bug
On Windows (haven't tried other OSes, but would expect the same), if the Azure CLI client is logged out, then the
AzureCliCredentialclass will raiseClientAuthenticationError, which causes the credential chain to stop. A common need is to includeInteractiveBrowserCredentialas the final link in a chained credential, and this bug prevents it from being used.To Reproduce
Steps to reproduce the behavior:
credentialfor some purpose that would cause it to retrieve a token.Expected behavior
I believe if the
AzureCliCredentialclass were to raiseCredentialUnavailableErrorinstead, then the chain would continue.Additional context
Found in the course of attempting to work around Azure/azure-sdk-for-net#8934.