Report #9265
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity
Run \`az login\` to refresh the Azure CLI token cache, or switch the application to use ClientSecretCredential or ManagedIdentityCredential instead of AzureCliCredential in production environments.
Journey Context:
Developer has a long-running Azure Function that uses DefaultAzureCredential to connect to Key Vault. It works for weeks then starts throwing 'Azure.Identity.AuthenticationFailedException: AADSTS700082'. They check the Azure Portal and see the app registration hasn't changed. They realize the function is using the developer's cached Azure CLI credentials from when they deployed it, not a managed identity. The CLI token expired after 90 days of inactivity. They run \`az login\` locally to refresh their CLI token and redeploy, but realize the proper fix is to switch to ManagedIdentityCredential in production, or run \`az login\` on the deployment machine. The immediate fix of \`az login\` works because it obtains a new refresh token valid for another 90 days.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:43:54.338754+00:00— report_created — created