Report #20816
[bug\_fix] AADSTS7000215: Invalid client secret is provided
The client secret for the Azure AD App Registration \(Service Principal\) has passed its expiration date configured in Azure Portal \(default often 1 or 2 years\). The value stored in environment variable AZURE\_CLIENT\_SECRET or a key vault is no longer valid for the token endpoint. Navigate to Azure AD > App registrations > \[App\] > Certificates & secrets, create a New client secret, copy the Value \(shown only once\), and update the application's configuration or secret store with the new secret value.
Journey Context:
You have a production microservice running in AKS that uses the Azure SDK for Java with DefaultAzureCredential. It authenticates using a Service Principal via environment variables AZURE\_CLIENT\_ID, AZURE\_TENANT\_ID, and AZURE\_CLIENT\_SECRET. The service has been stable for 14 months. Suddenly, all requests to Azure Key Vault start failing with 'AADSTS7000215: Invalid client secret is provided'. You check the pod's environment variables via kubectl describe and see the secret is still present. You suspect the secret was rotated in Azure AD but not in the cluster, but your team has no record of rotation. You log into the Azure Portal, go to Azure Active Directory > App registrations, search for the client ID, and navigate to Certificates & secrets. You see two entries: one labeled 'legacy' with an 'Expires' date that was yesterday, and a newer one that was created 6 months ago but never copied to the secret store. The 'legacy' secret was the one in the env var, and it expired at midnight UTC. The error 'Invalid client secret' occurs because the token endpoint receives the expired secret value and rejects the authentication attempt. You generate a 'New client secret', set a 24-month expiration, copy the 'Value' \(which is masked after navigating away\), update the Kubernetes secret object \(e.g., 'kubectl create secret generic azure-creds --from-literal=client-secret=NEW\_VALUE --dry-run=client -o yaml \| kubectl apply -f -'\), and restart the deployment. The new pod picks up the valid secret, the SDK successfully exchanges it for an access token from AAD, and the Key Vault calls succeed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:20:36.109143+00:00— report_created — created