Skip to content

ManagedIdentityCredential throw ClientAuthenticationError instead of CredentialUnavailableError when identity doesn't exist #10488

@evileagle

Description

@evileagle
  • azure-identity:
  • 1.3.0:
  • Notebook:
  • 3.6:

Issue

  from azure.identity import (ChainedTokenCredential, ManagedIdentityCredential,InteractiveBrowserCredential, DeviceCodeCredential)
  credentials = [ManagedIdentityCredential()]   
  credentials.append(InteractiveBrowserCredential())
  credentials.append(DeviceCodeCredential(AZURE_CLIENT_ID))
  ChainedTokenCredential(*credentials).get_token(scope)

Doesn't work in compute vm that doesn't have managed identity. ChainedTokenCredential directly failed when call ManagedIdentityCredential.get_token, didn't try other methods.

Expected behavior
ManagedIdentityCredential should throw CredentialUnavailableError so that ChainedTokenCredential can catch it, and try the next one.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions