Report #96674
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity
Run \`az login\` to perform a fresh interactive authentication and obtain a new refresh token. Root cause: Microsoft Entra ID \(Azure AD\) refresh tokens for public clients \(like Azure CLI\) have a maximum inactive lifetime of 90 days by default. If no token refresh occurs for 90 days, the refresh token is purged from the identity provider, and the local cached token in ~/.azure/ becomes invalid.
Journey Context:
You have a nightly CI pipeline that runs on a self-hosted agent. It uses the Azure CLI with a service principal, but for ad-hoc tasks you use your personal account via \`az login\` which you did months ago. Today you try to run \`az group list\` and get 'AADSTS700082: The refresh token has expired due to inactivity'. You check \`az account show\` and it shows the same error. You look at the timestamp in the error and see it corresponds to 90 days ago. You realize that the Azure CLI stores a refresh token in \`~/.azure/msal\_token\_cache.json\`. Unlike service principal credentials, user refresh tokens expire after 90 days of non-use as per Entra ID policy. You run \`az login\`, authenticate via browser/device code, and the command succeeds. You verify the new token cache file has a recent timestamp.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:51:12.155597+00:00— report_created — created