Report #15672
[bug\_fix] AzureCliCredential: Azure CLI not installed, or token has expired. Please run 'az login'
Run \`az login\` in the terminal to refresh the Azure CLI token cache, or switch to \`VisualStudioCodeCredential\` or \`AzurePowershellCredential\` for local dev, or use \`ManagedIdentityCredential\` in production. Root cause: \`DefaultAzureCredential\` attempts \`AzureCliCredential\` as part of its chain. The Azure CLI stores an access token in \`~/.azure\` which expires after 1 hour \(or less depending on tenant policy\). Once expired, the credential provider throws, halting the chain unless another method succeeds.
Journey Context:
A developer runs an ASP.NET Core app locally that uses \`DefaultAzureCredential\` to connect to Azure Key Vault. It works perfectly for the first hour after they start work. Suddenly, all HTTP requests start failing with 'Authentication failed'. They check the Key Vault access policies, verify the Service Principal has 'Get' and 'List' permissions, and restart the app. It works for another hour, then fails again. They check the logs and see 'AzureCliCredential authentication failed: token expired'. They run \`az login\` again and the issue is resolved. They later refactor to use \`VisualStudioCredential\` to avoid the hourly expiry during local dev.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:45:52.019907+00:00— report_created — created