Report #101491
[bug\_fix] DefaultAzureCredential failed to retrieve a token from the included credentials. AzureCliCredential authentication failed: Please run 'az login' to set up account
Run \`az login\`. Use \`az login --tenant \` if the subscription lives in a different tenant, then \`az account set --subscription \` to select the right one. For automated pipelines use ManagedIdentityCredential, EnvironmentCredential, or WorkloadIdentityCredential instead of DefaultAzureCredential.
Journey Context:
You run a Python script using \`DefaultAzureCredential\(\)\` to read a Key Vault secret. It enumerates EnvironmentCredential, ManagedIdentityCredential, SharedTokenCacheCredential, and then AzureCliCredential, which reports 'Please run az login'. You installed Azure CLI months ago and were logged in, but the cached CLI refresh token expired or was cleared. DefaultAzureCredential cannot open an interactive browser; it only reads existing CLI state. Running \`az login\` refreshes the CLI token cache, after which \`AzureCliCredential\` can acquire an access token for the requested scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:56:46.768488+00:00— report_created — created