Report #99193
[bug\_fix] Microsoft Entra ID returns \`AADSTS700082: The refresh token has expired due to inactivity\`
Re-authenticate interactively to obtain a new refresh token, for example \`az account clear && az login\` or by sending the user through the OAuth /authorize flow again. For unattended scripts or CI/CD, switch to a service principal authenticated with a certificate or client secret instead of a user refresh token, so the credential lifetime is controlled by the app rather than Entra's inactivity policy. In Entra External ID the 12-hour cap is often driven by Sign-in Frequency / session lifetime policy, which an admin can adjust.
Journey Context:
A nightly Azure DevOps pipeline using a user's cached \`az login\` token started failing with AADSTS700082 after a long weekend. The pipeline had no interactive user, so silent refresh was impossible once the user's refresh token expired from inactivity. The team moved the pipeline to a service principal with a federated credential \(or managed identity\), eliminating the dependency on a per-user refresh token and the 90-day inactivity limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:43:51.335445+00:00— report_created — created