Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My Microsoft 365 integration stopped because its secret expired

Short answer

An app that signs in to Microsoft 365 as itself uses a client secret, and Microsoft limits a secret's life to 24 months or less, recommending under 12. When it ends, the app stops. A new secret fixes it, but its value is shown only once. Microsoft recommends certificates for production.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • An integration that ran for a long time stopped overnight.
  • Sign-in errors mention the client secret, invalid client or expired credentials.
  • Nobody knows who created the app registration or where its secret is stored.
  • Mail, calendar or SharePoint automation from my app no longer works.
  • It stopped on a date that is a year or two after setup.

Why does this happen?

  1. Secrets have a fixed end date

    Microsoft states that a client secret's lifetime is limited to two years (24 months) or less, that you cannot set a custom lifetime beyond that, and that it recommends an expiration of less than 12 months. When the date passes, the app can no longer prove who it is.

  2. The value is shown only once

    Microsoft states that the secret value is never displayed again after you leave the page where it is created. Whoever set it up had to copy it into the app. If a new secret is created but the old value stays in the app, nothing changes.

  3. Secrets are the weaker option

    Microsoft recommends a certificate rather than a client secret before moving an app to production, and says secrets are less secure and should not be used in production environments.

  4. Nobody owns the renewal

    The person who registered the app has left, or the registration sits in a tenant nobody checks, so no one saw the date coming.

  5. The secret is stored in several places

    The same secret may be pasted into a server setting, an automation tool and a script. Updating one leaves the others failing with the old value.

What can I do about it today?

  1. Ask a Microsoft 365 admin to open the app registrationIn the Microsoft Entra admin center, under App registrations, the Certificates and secrets page lists each secret and its expiry date.
  2. Write down where the secret is usedAsk your developer or automation owner which servers, tools and scripts hold it.
  3. Do not delete the old secret firstCreate the new one, put it everywhere it is needed, check it works, and only then remove the expired one.
  4. Never send the secret by email or chatGive it to the person who needs it through a password manager or a protected setting.
  5. Put the next expiry date in a calendarSet a reminder well before it, and name a person responsible.

When should I bring someone in?

  • You cannot find the app registration or nobody is an admin of it.
  • The secret is used in many places and you are unsure which.
  • You want to replace secrets with certificates or another safer method.

How do I handle it?

  1. Find the registration and its usersI identify the app registration, the permissions it holds and every place the secret is used, from your side's list and the app's settings.
  2. Create the new credential alongside the oldA second credential is added, so the old one keeps working until the switch is checked.
  3. Update every place, then testServers, tools and scripts are updated and tested with a harmless request before the old credential is removed.
  4. Prefer a certificate or managed identityWhere the app can use a certificate or an Azure managed identity, as Microsoft recommends, I move it there so there is less to expire.
  5. Set reminders and an ownerYou get the expiry dates written down, and a named person who gets the reminder.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Can I make a secret that never expires?

No. Microsoft states a secret's lifetime is limited to 24 months or less. A certificate can be used instead, and it has its own expiry date.

I lost the secret value. Can it be shown again?

No. Microsoft states that the value is never displayed again after leaving the page. A new secret must be created and put in the app.

Will users be affected while this is fixed?

Anything that depends on the app signing in, such as automated mail or file jobs, is paused until the new credential is in place.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.