Report #37850
[bug\_fix] Azure CLI refresh token expired causing AADSTS700082 in DefaultAzureCredential
Run \`az login\` to refresh the Azure CLI token cache. The root cause is Azure CLI refresh tokens expire after 90 days of inactivity or due to Conditional Access policies; the SDK's DefaultAzureCredential chain attempts to use AzureCliCredential but the cached token in \`~/.azure/\` is stale and cannot be refreshed without interactive login.
Journey Context:
Developer has a CI script that ran \`az login\` months ago then executes a Python app using DefaultAzureCredential. It suddenly fails with \`AADSTS700082: The refresh token has expired due to inactivity\`. Checks \`az account show\` and sees the subscription, but the Python SDK fails. Tries \`az account get-access-token\` and sees it fails with the same error. Realizes the refresh token in \`~/.azure/msal\_token\_cache.json\` \(or older \`accessTokens.json\`\) is stale. Running \`az login\` forces a new OAuth2 flow, obtaining a new refresh token, and the SDK works again.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:00:46.258366+00:00— report_created — created