AADSTS7000215 - Invalid Client Secret Provided
Azure AADSTS7000215 indicates that the client secret value provided in a token request is invalid for the specified application. This is a specific credential mismatch often caused by using the Secret ID instead of the actual secret value or by rotation drift.
Last reviewed: April 10, 2026|Editorial standard: source-backed technical guidance
What Does Invalid Client Secret Provided Mean?
AADSTS7000215 is a value mismatch failure. When an application performs a client-credentials flow, it sends its client_id and a client_secret. Entra ID looks up the app, finds the hashes of its active secrets, and compares them. If the app itself is correct but the secret does not match, you get this error. It is a precise indicator that the application is talking to the right house, identified by the client ID, but trying to use the wrong key, meaning the secret value.
Common Causes
- -Secret ID vs. Secret Value: The most common mistake. Developers copy the Secret ID GUID from the portal instead of the actual secret value.
- -Rotation Propagation Delay: A new secret was generated, but the application is still pulling an old invalid secret from a cache or outdated environment variable.
- -Truncated Secrets: Copy-paste, CI/CD injection, or escaping issues trim or alter the secret string.
- -Environment Mix-up: The app is using a production client ID with a staging client secret, or the reverse.
- -Key Vault Version Pinning: The app is configured to pull a specific version of a secret from Azure Key Vault and that version is no longer the valid one.
How to Fix Invalid Client Secret Provided
- 1Double-Check The String: Ensure your client secret is a true secret value string and not a 36-character GUID.
- 2Create A Fresh Secret: If there is any doubt, create a new secret in the portal and copy the value immediately.
- 3Restart The Service: If Key Vault, app settings, or environment variables were updated, restart the workload to clear cached credential state.
- 4Verify Client ID Alignment: Make sure the
client_idin your config matches the app registration where the secret was created.
Step-by-Step Diagnosis for Invalid Client Secret Provided
- 1Open the Entra admin center and navigate to App Registrations > Certificates & Secrets. Verify that at least one secret is active and not expired.
- 2Inspect runtime logs to verify which secret source is being loaded, without logging the full secret value.
- 3If using Azure Key Vault, confirm the workload has permission to read the secret and is reading the expected version.
- 4Compare the secret-related values in config with the app registration. If the stored value matches the Secret ID, you have found the problem.
AADSTS7000215 vs AADSTS50012
- -AADSTS7000215: Specifically targets a bad secret value.
- -AADSTS50012: Broader invalid client-auth family that can also include certificates, assertions, and other client credential failures.
The Ghost Instance Problem
- -In multi-instance deployments such as Kubernetes or scaled App Service plans, some instances may update while others keep the old secret. This creates intermittent AADSTS7000215 errors until the full fleet is refreshed.
- -If the error started immediately after rotation, compare secret versions and restart timing across every instance before looking for deeper protocol issues.
Implementation Examples
// Ensure you are using the real secret value, not the Secret ID
const clientConfig = {
auth: {
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET_VALUE,
authority: "https://login.microsoftonline.com/your-tenant-id",
},
};curl -X POST "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token" \
-d "client_id={id}" \
-d "scope=https://graph.microsoft.com/.default" \
-d "client_secret={SECRET_VALUE_HERE}" \
-d "grant_type=client_credentials"How to Verify the Fix
- -Confirm the application can successfully obtain a token using the updated secret value.
- -Check Entra sign-in logs, filtering by service principal, and verify the status transitions from Failure to Success.
- -Ensure the old failing secret is no longer referenced anywhere in deployment configuration.
How to Prevent Recurrence
- -Use Managed Identities: If the workload runs on Azure, remove secrets entirely where possible.
- -Use Key Vault References: Centralize secret retrieval so the platform handles access and freshness more reliably.
- -Set Rotation Alarms: Warn the team before a secret expires so rotation can be planned and verified.
- -Pro tip: If you lose the secret value shown at creation time, do not guess. Delete it and create a new one. Guessing usually leads straight to AADSTS7000215.
Decision Support
Compare Guide
401 Unauthorized vs 403 Forbidden: Auth vs Access Denied
Fix 401 Unauthorized vs 403 Forbidden by separating authentication failures from authorization denials, then apply the right login or permission fix fast.
Playbook
Auth Incident Playbook (401 / UNAUTHENTICATED)
Use this playbook to separate missing, expired, or invalid identity proof from authorization and transport failures, and apply credential-source-correct fixes safely.
Official References
Provider Context
This guidance is specific to Azure services. Always validate implementation details against official provider documentation before deploying to production.