Secret expiry tracker
Load an export of your app registrations and see every client secret and certificate in the order they expire, with the apps that are already broken at the top. Then download an Outlook calendar with a reminder before each one runs out.
- Free
- Runs in your browser
- No sign-up
Runs entirely in your browser. Nothing you paste is sent anywhere.
Not sure how to get it? See get the export below. Microsoft never returns secret values when you read an app, so the export only holds names, IDs and dates. The sample is made up: contoso.com and every app in it are fictional.
Get the export
With Microsoft Graph PowerShell. Application.Read.All is enough, and it only reads. The export is saved to C:\Temp\apps.json (the folder is created if it doesn't exist), ready to load with load export above.
Connect-MgGraph -Scopes "Application.Read.All"
New-Item -ItemType Directory -Path C:\Temp -Force | Out-Null
Get-MgApplication -All -Property DisplayName,AppId,PasswordCredentials,KeyCredentials |
Select-Object DisplayName, AppId, PasswordCredentials, KeyCredentials |
ConvertTo-Json -Depth 5 | Out-File C:\Temp\apps.json -Encoding utf8What each line does
- Line 1: Signs in to Microsoft Graph with the permissions (scopes) listed.
- Line 2: Creates an item. Makes a change.
- Line 4: Reads application details from Microsoft Graph.
- Line 5: Keeps only the properties listed, so the output stays small.
- Line 6: Turns the results into JSON text.
SAML single sign-on certificates live on the enterprise app (the service principal), not the app registration. To include them, export those too (to C:\Temp\enterprise-apps.json) and load both files together:
Get-MgServicePrincipal -All -Property DisplayName,AppId,ServicePrincipalType,KeyCredentials,PasswordCredentials |
Where-Object { $_.KeyCredentials -or $_.PasswordCredentials } |
Select-Object DisplayName, AppId, ServicePrincipalType, KeyCredentials, PasswordCredentials |
ConvertTo-Json -Depth 5 | Out-File C:\Temp\enterprise-apps.json -Encoding utf8What each line does
- Line 1: Reads service principal details from Microsoft Graph.
- Line 2: Keeps only the items that match the condition.
- Line 3: Keeps only the properties listed, so the output stays small.
- Line 4: Turns the results into JSON text.
Or with the Azure CLI, from PowerShell:
New-Item -ItemType Directory -Path C:\Temp -Force | Out-Null
az ad app list --all `
--query "[].{displayName:displayName, appId:appId, passwordCredentials:passwordCredentials, keyCredentials:keyCredentials}" `
-o json | Out-File C:\Temp\apps.json -Encoding utf8What each line does
- Line 1: Creates an item. Makes a change.
- Line 4: Writes the output to a file.
Or in Graph Explorer, run this and copy the response:
GET https://graph.microsoft.com/v1.0/applications?$select=displayName,appId,passwordCredentials,keyCredentials&$top=999The calendar
- The download is a standard
.icsfile. In Outlook, open it or drag it into your calendar, and choose to add the events to a new calendar so you can share it with your team or remove it in one go. - Each reminder is an all-day event with the app name, app ID, credential name and expiry time in UTC, so whoever picks it up can find the right app straight away.
- The file is a snapshot. If you add or renew secrets, load a fresh export and download the calendar again. Every event has a fixed ID, so importing it again updates events instead of duplicating them in most calendar apps.
How it works
- Client secrets come from
passwordCredentialsand certificates fromkeyCredentials. The expiry is the credential'sendDateTime, which Microsoft stores in UTC. - A SAML signing certificate usually appears twice on an enterprise app, once for signing and once for verifying. Entries with the same certificate thumbprint and expiry are shown once.
- An app is only shown as at risk if it has no other credential of the same kind that lasts longer. If it does, the old one is probably left over from a renewal and can be deleted.
- Nothing is uploaded. The file is read in your browser, and the calendar is built there too.