Fabric · Data Factory · Databricks · Credentials

AADSTS7000222: the provided client secret keys are expired

The client secret of the app registration your pipeline signs in with has passed its expiry date, so Microsoft Entra ID will not issue a token. An expired secret cannot be renewed. Create a new one and put its value wherever the old one was stored.

The error
Failed to get access token by using service principal. Error: invalid_client, Error Message: AADSTS7000222: The provided client secret keys for app '00000000-0000-0000-0000-000000000000' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds.

What this error means

A service principal proves who it is with a credential. A client secret always has an end date: Microsoft limits its lifetime to 24 months and recommends less than 12. From that date every sign-in with the secret fails with AADSTS7000222, and so does every activity or task that depends on it, in Azure Data Factory, Microsoft Fabric and Databricks alike.

Nothing is wrong with the app registration, its permissions or your pipeline. The neighbouring code AADSTS7000215 means the secret is invalid and not expired, for example because the secret’s ID was used in place of its value.

Why it happens

  • The secret reached its expiry date. It was created with a fixed lifetime, and nobody was reminded when the date came.
  • A new secret exists but is not in use. The new value was created in the portal, while the linked service, connection or Key Vault secret still holds the old one.
  • Only one of several copies was updated. The same app registration is used by a Data Factory linked service, a Fabric connection and a Databricks secret scope, and each keeps its own copy.

How to fix it

  1. Identify the app

    The error contains the application (client) ID. In the Microsoft Entra admin center, open App registrations and search for that ID.

  2. Create a new client secret

    Under Certificates & secrets, select New client secret, choose an expiry date, and copy the Value at once. It is never shown again after you leave the page.

  3. Update every place that stores it

    In Azure Data Factory, update the linked service, or better the Key Vault secret it refers to: a reference without a fixed version uses the latest version from the next run. In Microsoft Fabric, edit the connection’s credentials. In Databricks, update the secret in its secret scope; storage mounted with the old secret has to be unmounted and mounted again.

  4. Test, rerun and tidy up

    Test the connection, rerun the failed pipeline or job, and delete the expired secret from the app registration once everything works.

How to stop it coming back

  • Use a managed identity where the service supports one. It has no secret to expire.
  • Keep the secret in Azure Key Vault and refer to it without a fixed version, so one update reaches every pipeline.
  • Write down each secret’s expiry date and set a reminder a few weeks before it.
  • For production, Microsoft recommends certificates or federated credentials in place of client secrets.

With PipelineMender AI

The next failed run explains itself.

PipelineMender reads the failing activity’s error on Microsoft Fabric and Azure Data Factory, and the failed task’s error on Databricks. For this failure the report recognises the expired credential from the AADSTS7000222 code, quotes the application ID from the error, and lists what to renew and where for you to review.

Is the error in front of you now? Start a trial, choose Report an incident and paste it in. No connection is needed for that.

  • Read-only access
  • You review every change
  • No model training

Questions

Common questions about this error.

Can I extend or renew an expired client secret?

No. An expired secret cannot be reactivated. Create a new secret on the same app registration and replace the stored value.

How long can a client secret last?

At most 24 months when it is created in the Microsoft Entra admin center. Microsoft recommends an expiry of less than 12 months.

What is the difference between AADSTS7000222 and AADSTS7000215?

AADSTS7000222 means the secret has expired. AADSTS7000215 means the secret is invalid, for example because the secret ID was used in place of the secret value.

Checked against: Microsoft Entra authentication and authorization error codes Add and manage app credentials in Microsoft Entra ID Store credentials in Azure Key Vault Managed identities for Azure resources Databricks: HTTP 401 on an ADLS mount after a secret expired

Last reviewed 13 November 2026 against Microsoft’s and the Databricks documentation. PipelineMender AI is an independent product and is not affiliated with Microsoft or Databricks; product names are trademarks of their owners.