Skip to main content
AppAlert

AADSTS7000215: invalid client secret provided

Reviewed

On this page
Error message returned by Microsoft Entra
AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '<application-id>'.

What the message means

The app sent Microsoft Entra ID (formerly Azure AD) a client secret that matches none of the app's current secrets. Microsoft's error reference says only: "Invalid client secret is provided." The longer message points to the most common cause: the secret ID was sent instead of the secret value.

An expired secret usually returns AADSTS7000222 instead. Work through the cases below before you create a new secret. Microsoft's AKS troubleshooting article says: "A typing error or using a secret ID instead of the value doesn't require a new secret."

Microsoft notes that error codes and messages can change. Match the message text as well as the code.

Which case is yours

The secret ID was sent instead of the value. The portal shows two columns for each secret: Value and Secret ID. The Secret ID is a GUID that identifies the secret. The Value is the secret itself, shown only once when you create it. If the configured secret looks like a GUID, it is probably the ID.

The client ID and secret do not belong together. The secret is valid, but for another app registration. The AKS article lists a "mismatched client ID/secret pair" as a cause. Compare the application ID in the message with the app that holds the secret.

The value was changed on the way. A Microsoft moderator names copy-paste errors such as extra spaces or characters. Check the stored value for whitespace, quotes, or truncation, and compare its first three characters with the secret's hint.

The secret was deleted from Entra. The AKS article notes that a workload "can also encounter this error if it still uses a credential deleted from Entra". This often follows a renewal where the old secret was removed before every consumer moved over.

Fix it

  1. List the app's secrets with Azure CLI and check that a secret with an unexpired end date exists. Each secret's hint holds the first three characters of its value.

    az ad app credential list --id '<application-id>' --output table
    
  2. Compare the configured value with what you expect: the value, not the ID, for this application ID, without extra characters. If you still have the value in your secret store, correct the consumer's configuration and retry. No new secret is needed.

  3. If nobody has the value any more, add a new secret. With Azure CLI, use az ad app credential reset --append so the existing secrets stay in place. Copy the value immediately. The portal does not show it again.

  4. Update the consumer and force a fresh token request. Then confirm the key ID in the sign-in logs with Identify the active credential.

  5. If you created a new secret, roll it out to every consumer listed in Where the old credential still lives before you remove any old secret.

Where the old credential still lives

When a deleted or mistyped secret causes the error, the wrong value sits in one of the systems that store a copy:

  • Key Vault secrets and the apps that read them at startup.
  • App settings and environment variables in App Service, Functions, and container platforms.
  • Azure DevOps service connections and variable groups, and secrets in other CI systems. See Azure DevOps service connection secret expired.
  • AKS clusters that sign in with a service principal.
  • Configuration files and scheduled tasks on servers and integration hosts.
  • Third-party products that store the client ID and secret in their own settings.

Prevent the next one

Store the value in your secret store at the moment you create it, and record which app and key ID it belongs to. Name each secret after its consumer so you know which copy to update.

Before you delete a secret, check in the sign-in logs that no workload still uses its key ID. A renewal that deletes too early is the usual path to this error. The client secret renewal guide gives a safe order, and App secret expiration notifications compares the ways to be warned before a secret expires.

FAQ

What is the difference between the secret ID and the secret value?

The secret ID is a GUID that identifies the secret on the app. The value is the secret itself. Entra shows the value once, when you create the secret, and only the value works in a token request.

Does AADSTS7000215 mean the secret has expired?

Usually not. An expired secret returns AADSTS7000222. AADSTS7000215 means the value matches no current secret: a typo, the ID instead of the value, a value for another app, or a deleted secret.

Do I need to create a new client secret?

Only if nobody has the correct value any more. If the cause is a typo, the secret ID, or the wrong app ID, fix the configuration instead.

Why did AADSTS7000215 start right after I renewed a secret?

The old secret was probably deleted while a workload still used it. Find that workload and give it the new value.