Report #71306
[bug\_fix] AADSTS7000215 / AADSTS7000222 Invalid or expired client secret \(Azure\)
Rotate the client secret in the Azure AD App Registration \(Microsoft Entra ID\), copy the new secret value, and update the application's environment variable or Key Vault reference. The root cause is that client secrets have a defined expiration date \(e.g., 6 months, 1 year, or 2 years\) and become invalid after that timestamp, causing all token requests to fail.
Journey Context:
A DevOps engineer deploys a microservice to Azure Kubernetes Service \(AKS\) that uses a Service Principal to access Azure Key Vault via the Azure SDK for Python. The application runs perfectly for 6 months. Suddenly, on a Monday morning, all pods start crash-looping with Azure.Identity.AuthenticationFailedException: 'AADSTS7000215: Invalid client secret is provided'. The engineer checks the Service Principal in Microsoft Entra ID > App registrations > Certificates & secrets. They see the client secret listed with a red 'Expired' badge next to the expiration date \(6 months ago\). They realize the secret expired over the weekend. They create a new secret, copy the value, update the Kubernetes secret holding the credential, and restart the pods. The service recovers. To prevent recurrence, they implement a script to alert on secrets expiring within 30 days or switch to workload identity \(federated credentials\) which doesn't require secrets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:15:39.316195+00:00— report_created — created