Entra app secret and certificate expiration
Facts copied from Microsoft Learn on 2026-12-01. Each row links to its source. Microsoft changes these pages, so check them before you rely on a number.
| Topic | Value | Details |
|---|---|---|
| Client secret maximum lifetime | 24 months | You can't set a custom lifetime longer than 24 months. Microsoft recommends less than 12 months, and recommends certificates or federated credentials over secrets in production. Source |
| SAML signing certificate default lifetime | 3 years | Entra ID creates a self-signed certificate valid for three years when you set up SAML sign-on. A new one can be dated anywhere up to three years out. Source |
| Built-in SAML certificate expiry emails | 60, 30 and 7 days before | Sent from azure-noreply@microsoft.com to up to five notification addresses per app. Nothing similar exists for app registration client secrets or certificates. Source |
| Error after a secret expires | AADSTS7000222 | InvalidClientSecretExpiredKeysProvided: the provided client secret keys are expired. Create new keys for your app, or use certificate credentials. Source |
| Azure DevOps service connections | Renew from Azure DevOps | If an Azure DevOps service connection created the service principal, update its secret from the Azure DevOps portal, not directly in Entra ID. Source |
| Permission needed to read all app credentials | Application.Read.All | Least privileged application permission for List applications and List owners of an application in Microsoft Graph v1.0. Source |
List secrets that expire in the next 60 days
Azure CLI, signed in as someone who can read app registrations:
az ad app list --all --query "[].{app:displayName, appId:appId, secrets:passwordCredentials[].endDateTime, certs:keyCredentials[].endDateTime}" -o json
Microsoft Graph PowerShell:
Connect-MgGraph -Scopes Application.Read.All
$limit = (Get-Date).AddDays(60)
Get-MgApplication -All -Property displayName,appId,passwordCredentials,keyCredentials | ForEach-Object {
$app = $_
@($app.PasswordCredentials) + @($app.KeyCredentials) | Where-Object { $_.EndDateTime -lt $limit } |
Select-Object @{n='App';e={$app.DisplayName}}, @{n='AppId';e={$app.AppId}}, DisplayName, EndDateTime
}
This covers app registrations. Enterprise apps (service principals) can carry their own secrets and SAML signing certificates; list them with Get-MgServicePrincipal and the same properties.
Automate it
Entra App Secret and Certificate Expiry Alerts runs this check every day, alerts at 60, 30, 14, 7 and 1 days on email, Slack or Teams, emails each app's contacts, and shows which Azure DevOps service connections use each app. Disclosure: we wrote this page and sell the tool.
Corrections: support@puzaricloud.in. Microsoft Entra and Azure DevOps are trademarks of Microsoft. This site is not run by Microsoft.