Report #42748
[bug\_fix] DefaultAzureCredential failed to retrieve a token from the included credentials. EnvironmentCredential... ManagedIdentityCredential... AzureCliCredential... are unavailable
Run \`az login\` to authenticate the Azure CLI, which DefaultAzureCredential will then use to fetch tokens. Alternatively, set the environment variables AZURE\_CLIENT\_ID, AZURE\_TENANT\_ID, and AZURE\_CLIENT\_SECRET for service principal authentication, or ensure Managed Identity is assigned in Azure.
Journey Context:
Developer runs a .NET application locally that uses DefaultAzureCredential to connect to Azure Key Vault. Gets exception listing all attempted credential types \(EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, AzureCliCredential\) and that they failed. Developer checks Managed Identity - but running locally, not in Azure. Checked environment variables - not set. Realizes DefaultAzureCredential tries: Environment -> WorkloadIdentity -> ManagedIdentity \(IMDS endpoint 169.254.169.254 - fails locally\) -> AzureCliCredential \(checks \`az account show\` - fails if not logged in\). Developer runs \`az login\`, completes browser auth. Re-runs app - AzureCliCredential succeeds because it can now execute \`az account get-access-token\`. App works.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:13:20.663775+00:00— report_created — created