Report #98716
[bug\_fix] Azure CLI subscription not found or token expired: Please run 'az login'
Run \`az login\` and then \`az account set --subscription \` to refresh the Azure AD token and select the active subscription. The root cause is that \`az\` tokens expire and the default subscription may be disabled or removed, so the SDK cannot resolve a valid bearer token for API calls.
Journey Context:
A Terraform run started failing with 'Error building account: Error getting authenticated object ID' after the team cleaned up unused Azure subscriptions. \`az account show\` still returned a subscription, but it was a disabled one. They ran \`az login\` successfully, yet the error persisted because the default context pointed to the disabled subscription. Only after running \`az account list --output table\` and explicitly selecting the correct subscription with \`az account set --subscription\` did both the Azure CLI and the Terraform AzureRM provider work again.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:39:51.201733+00:00— report_created — created