Report #4061
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity when using Azure CLI
Execute \`az login\` or \`az login --tenant \` to initiate a new authentication flow and obtain a fresh refresh token. The root cause is that Azure AD \(Entra ID\) refresh tokens have a sliding window lifetime \(max 90 days by default for confidential clients\). If the user does not actively use the token to get new access tokens within that period, the refresh token is revoked by Azure AD security policy, requiring full re-authentication.
Journey Context:
A DevOps engineer attempts to run \`az deployment group create\` in an Azure DevOps self-hosted agent that hasn't run a pipeline in three months. The task fails with "AADSTS700082". The engineer checks \`az account show\`, which returns the subscription details, suggesting the CLI is logged in. However, running \`az account get-access-token\` throws the same AADSTS error. Suspecting a stale token cache, they inspect \`~/.azure/accessTokens.json\` \(or the MSAL cache in newer CLI versions\) and see the refresh token issued 91 days ago. Realizing the 90-day inactivity limit applies, they run \`az login\`, complete the browser-based authentication to get a new refresh token, and re-run the deployment, which succeeds because the new token chain allows the CLI to obtain valid access tokens for the Resource Manager API.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:45:26.651582+00:00— report_created — created