AADSTS7000215 "invalid client secret provided" service principal fix
Fixes the AADSTS7000215 invalid client secret error on Entra ID service principals: identifying the stale or wrong secret and rotating it safely. Use when a daemon app or integration suddenly cannot authenticate. Not for certificate-based auth or user sign-in failures.
TL;DR
The app is presenting a secret Entra ID does not recognize, almost always because it expired, was rotated without updating the app, or the wrong one of several secrets is configured. Generate a new client secret, update the app's stored value, and restart it.
The query
AADSTS7000215 "invalid client secret provided" service principal fixUse this when
- a service principal gets AADSTS7000215
- an integration worked until a date, then broke overnight
- the app config references a secret by name but auth fails
Not for
- certificate credential errors (AADSTS700027)
- user login or MFA failures
- expired access tokens on the client side
Steps
- In Entra ID, open the app registration, then Certificates and secrets, and note each secret's expiry date and ID. Expected output: you can see whether a secret recently expired.
- Find where the app actually reads its secret (config file, environment variable, or vault reference) and confirm which secret ID it should be using. Expected output: you know the app's configured secret and its source.
- Generate a new client secret with a sensible expiry and copy the value once. Expected output: a fresh secret value is displayed one time.
- Update the app's stored value to the new secret and restart or redeploy the app. Expected output: the app starts and authenticates successfully.
- Delete the old expired secret from the registration only after confirming the new one works. Expected output: one active secret remains and monitoring shows clean auth.
Applies to
Microsoft Entra ID app registrations with client-secret credentials, daemon apps, API integrations, all current portal versions.
Variant phrasings
Secret looks right but still 7000215
A second secret exists and the app sends the older one; match by secret ID in the sign-in log.
7000215 right after a key vault rotation
The app cached the old value; force a restart or config reload so it picks up the new one.
Why it happens
Secrets expire on a schedule, and rotations frequently update Entra ID without updating every consumer. The error only says invalid, so the detective work is matching which secret the app actually sends.
Edge cases
- Prefer certificate credentials over secrets for long-lived integrations; they rotate more cleanly.
- Document the expiry in your calendar or secret-expiry monitoring; this error recurs on schedule otherwise.
- If the app runs in multiple places, update every copy of the stored secret, not just one.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_M1aCTquePuHaggErdfIEiA