Report #16146
[bug\_fix] AADSTS7000215: Invalid client secret is provided
Create a new client secret in Azure AD App Registration > Certificates & secrets, update the application configuration with the new secret value, and set a calendar reminder before expiration. For production, migrate to client certificate credentials or Managed Identity to eliminate secret expiration issues.
Journey Context:
Developer has a scheduled Azure Function that calls Microsoft Graph API using the client credentials flow \(client ID \+ secret\). It works reliably for 6 months. Suddenly, all executions start failing with AADSTS7000215. Developer checks the application configuration and the client secret matches what was stored in Azure Key Vault. They try regenerating the secret from the Azure Portal under App registrations > Certificates & secrets and notice the old secret shows 'Expired' with yesterday's date. They create a new secret, update the Key Vault value, and the application works again. The error message 'Invalid client secret' is misleading because it doesn't specify 'Expired', leading the developer to initially suspect a configuration drift or key corruption rather than expiration. The root cause is that Azure AD client secrets have a maximum lifetime \(configurable up to 730 days or unlimited in some tenants, but best practice enforces rotation\), and the application did not implement secret rotation logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:54:28.732342+00:00— report_created — created