Report #57786
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity
The refresh token in the Azure CLI cache \(\`~/.azure/msal\_token\_cache.json\`\) or obtained via \`az login\` has exceeded the tenant's maximum inactive time \(default 90 days\). The DefaultAzureCredential relies on this cache. Execute \`az login\` again to perform an interactive authentication and obtain a new refresh token. For automation, use Service Principals or Managed Identities instead of user credentials.
Journey Context:
Developer returns from vacation and runs a local .NET app using DefaultAzureCredential to connect to Azure Key Vault. The app throws CredentialUnavailableException with 'AADSTS700082'. The developer checks \`az account show\` and sees they are still 'logged in' as a user. They try \`az account get-access-token --resource https://vault.azure.net\` and it fails with the same AADSTS700082 error. They search the error code and find Microsoft documentation explaining refresh token lifetimes. They realize that while the CLI shows an account, the underlying MSAL cache contains an expired refresh token. They run \`az login\`, complete the MFA prompt, and the application works. They understand that DefaultAzureCredential delegates to AzureCliCredential, which relies on the CLI's token cache subject to 90-day inactivity policies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:28:58.541023+00:00— report_created — created