Report #67627
[bug\_fix] DefaultAzureCredential failed to retrieve a token from the included credentials. EnvironmentCredential: Environment variable AZURE\_TENANT\_ID is not set. ManagedIdentityCredential: ManagedIdentityCredential is unavailable. AzureCliCredential: Azure CLI not installed...
Set the required environment variables \(AZURE\_TENANT\_ID, AZURE\_CLIENT\_ID, AZURE\_CLIENT\_SECRET\) to enable EnvironmentCredential, ensure the Azure CLI is installed and logged in \(\`az login\`\) for AzureCliCredential, or assign a Managed Identity to the Azure resource \(VM, App Service, etc.\). The root cause is that DefaultAzureCredential iterates through an ordered chain of credential providers \(Environment → Workload Identity → Managed Identity → Azure CLI → Azure PowerShell → Azure Developer CLI\) and all providers failed to acquire a token because their prerequisites were not met in the current execution environment.
Journey Context:
Developer writes an application using the Azure SDK \(e.g., Azure.Storage.Blobs\) and instantiates DefaultAzureCredential with the expectation that it will 'just work' across local dev and production. They deploy the app to a Docker container running in AKS without configuring any environment variables, workload identity, or managed identity. The SDK attempts to get a token: checks environment variables \(missing AZURE\_TENANT\_ID\), checks Workload Identity \(not configured\), checks IMDS endpoint for Managed Identity \(pod has no managed identity assigned, returns 400\), checks for Azure CLI \(not installed in slim container\), checks for Azure PowerShell \(not present\). Throws CredentialUnavailableException listing all attempted methods. Developer realizes DefaultAzureCredential requires explicit setup in containerized environments—either mounting Azure CLI credentials from host \(insecure\), setting env vars for client ID/secret, or enabling Workload Identity/Pod Identity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:59:47.516584+00:00— report_created — created