Report #4904
[bug\_fix] Azure DefaultAzureCredential failed to retrieve a token from the included credentials
Run \`az login\` in the terminal where the application runs to authenticate the Azure CLI, which \`DefaultAzureCredential\` attempts before other methods. Alternatively, set environment variables for a Service Principal \(AZURE\_CLIENT\_ID, AZURE\_TENANT\_ID, AZURE\_CLIENT\_SECRET\).
Journey Context:
A developer writes a new Python app using the Azure SDK and \`DefaultAzureCredential\`. It works perfectly in Azure Production \(using Managed Identity\), but locally it throws \`CredentialUnavailableError\` with a long list of tried credentials \(EnvironmentCredential unavailable, ManagedIdentityCredential unavailable, AzureCliCredential failed to invoke Azure CLI\). The developer checks the Azure portal to confirm they are an Owner on the subscription. They try setting environment variables manually but typo the client secret. Finally, they realize they simply never ran \`az login\` on this new laptop after installing the Azure CLI. Running the command opens a browser, they sign in, and the SDK immediately works because \`DefaultAzureCredential\` successfully invokes the now-authenticated Azure CLI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:16:45.700219+00:00— report_created — created