Microsoft 365 sign-in (Entra ID)

AADSTS7000215: invalid client secret is provided

AADSTS7000215 means an app sent a client secret that Microsoft Entra ID does not accept, often the secret ID instead of its value. How to check and replace it.

By EpiFive Editorial TeamSources checked How we check our guides

What the error means

AADSTS7000215 is returned when an application authenticates to Microsoft Entra ID as itself, with a client ID and client secret, and the secret it sends is not valid for that app registration. Microsoft's reference calls it a developer error: the app is attempting to sign in without the necessary or correct authentication parameters. The error affects service principals and background jobs rather than people, so it usually shows up in scripts, integrations, Azure services and SDK logs.

Microsoft's Azure Kubernetes Service (AKS) troubleshooting article gives the most useful version of the message: make sure the secret being sent is the client secret value, not the client secret ID. The Azure SDK for Java troubleshooting page lists the same code simply as "An invalid client secret was provided."

Common causes

From the Microsoft pages read for this entry:

  • The request sends the client secret ID instead of the client secret value.
  • An incorrect secret, or a client ID and secret pair that do not belong together, is supplied.
  • The workload still uses a credential that has since been deleted from Microsoft Entra ID.
  • An Azure service such as Azure CycleCloud holds an old secret after the secret was changed.

How to fix it

1. Check that you are sending the secret value

In the Azure portal open Microsoft Entra ID, App registrations, select the app, then Certificates & secrets. Microsoft's AKS article says the request must send the client secret value, not the client secret ID. As a general step, note that the value is only displayed when a secret is created; if nobody saved it, go to step 3.

2. Confirm the client ID and secret belong to the same app

Make sure the client (application) ID in your configuration is the app whose secrets you are checking. To list the secret metadata for an app from the command line, Microsoft's AKS articles use:

az ad app credential list --id "$APP_ID"

This shows secret metadata and expiry dates, not the secret values. Microsoft's AKS article adds that for AADSTS7000215 you should first correct the secret value and client ID pairing: a typing error or using a secret ID instead of the value doesn't require a new secret.

3. Create a new client secret

Under App registrations, select the application, then Certificates & secrets and New client secret. Microsoft's CycleCloud article notes that the new secret key value then appears in the list; copy it before you leave the page. The app secret expiry report guide shows how to match a configured value with a secret by its hint.

4. Update the workload that uses the secret

Put the new value wherever the app reads it. For Azure CycleCloud, Microsoft's steps are Configure, the account in Cloud Provider Accounts, Credentials, Edit, enter the value in Application Secret, then Validate and Save. For an existing AKS cluster, follow Microsoft's Update or rotate the credentials for an AKS cluster procedure, then retry the original operation.

5. Consider certificates or managed identities

Microsoft's CycleCloud article recommends certificate credentials or a managed identity instead of a client secret to avoid secret problems altogether, and rotating secrets on a schedule.

If nothing works

Compare the time of the failure, in UTC, with the secret's creation and expiry dates, and confirm the request goes to the tenant that owns the app registration. If the secret really is expired, the error is AADSTS7000222 and the same rotation fixes it.

What we checked

Four Microsoft Learn pages were read on 2026-11-21. The Microsoft Entra error code reference defines AADSTS7000215 as an invalid client secret and a developer error. The AKS BadRequest and InvalidClientSecret article explains the secret value versus secret ID problem, the mismatched pair and deleted credential causes, and the credential checks. The Azure CycleCloud article shows the error and the New client secret steps. The Azure SDK for Java page lists the code. The error was not reproduced for this page.

Last checked: 2026-11-21.

Official sources

Questions people ask

What does AADSTS7000215 mean?

The app authenticated to Microsoft Entra ID with a client secret that is not valid for its app registration. Microsoft calls it a developer error: the app is signing in without the correct authentication parameters.

I copied the secret and still get AADSTS7000215. What is wrong?

Microsoft's AKS article says to make sure the secret sent is the client secret value, not the client secret ID. The value is only shown once, when the secret is created; if it was not saved, create a new secret.

What is the difference between AADSTS7000215 and AADSTS7000222?

AADSTS7000215 is an invalid client secret, such as a wrong value, the secret ID, or a deleted secret. AADSTS7000222 means the secret is valid but has expired.

Guides that mention AADSTS7000215

Not your code?

Search the error code library, or report a code we don't cover. Spotted something out of date on this page? Report a correction.