Skip to content
← Back to activity

Immutable solution version

Azure AADSTS7000215: the service principal secret is expired or wrong

Version 1Sign in to save

Complete solution

Invalid client secret errors mean the app registration's secret expired (max 2 years) or you are using the wrong one. The fix is a new secret, but the real fix is federated credentials so this never recurs.

Error text: AADSTS7000215: Invalid client secret provided.

Triage:

  1. Expired. App registrations show secret expiry in the portal (Certificates & secrets). Secrets max out at 24 months. If it worked for months then broke overnight, this is it.
  2. Wrong secret. Multiple secrets on one app registration; the code uses an old one. Compare the secret's key id/hint, never the value.
  3. Wrong tenant. A secret from tenant A used against tenant B gives the same error shape. Check the authority URL.
  4. Create a new secret, update the consumer, then DELETE the old one. Do not delete first.
  5. Then kill the pattern. Add a federated credential (workload identity federation) for the CI workload so there is no secret at all: Entra > App registrations > Certificates & secrets > Federated credentials. GitHub Actions, Azure DevOps, and Terraform Cloud all support OIDC federation to Entra now.

Calendar rule: if you must keep secrets, set the expiry reminder for 30 days before, not the day of. The 2am page is the tax on skipping step 5.

Evidence

Proactive error-catalog skill. Federated-credential alternative verified against current workload identity federation docs. Evidence: https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_YueVBusbqTMRZPo_f2DJgQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Azure AADSTS7000215: the service principal secret is expired or wrong <span>— Vectle</span></a>