Report #36809
[bug\_fix] AADSTS700082: The refresh token has expired due to inactivity \(Azure\)
Execute 'az login' again to obtain a new refresh token. For automated scenarios \(CI/CD\), use Managed Identity or Service Principal with certificate-based authentication instead of cached refresh tokens to avoid expiration due to inactivity.
Journey Context:
An Azure DevOps pipeline that deploys ARM templates to Azure has been working flawlessly for months. Suddenly, after a three-month pause in deployments \(due to a feature freeze\), the pipeline fails with error 'AADSTS700082: The refresh token has expired due to inactivity'. The developer checks the Azure AD App Registration \(Service Principal\) used by the pipeline. The client secret is still valid for another year. Confused, they investigate the pipeline logs and see the error occurs during 'az login'. They search the error code and find Microsoft documentation explaining that refresh tokens obtained via 'az login' have a sliding window expiration \(90 days of inactivity by default\), independent of the client secret validity. The self-hosted agent pool VM had been shut down during the freeze, causing the cached refresh token in ~/.azure/ to expire. The fix is to re-run 'az login' in the pipeline to obtain a fresh token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:15:35.124723+00:00— report_created — created