azureblog.co.uk
← cd ~/posts

Rolling a SAML signing certificate without an outage

Entra SAML signing certificates expire after three years by default. Here's the cutover plan I use so nobody notices the change.

2 min read⚠ checked 22 Oct 2025Entra ID
On this page
  1. Before the change
  2. The rollover
  3. Quick inventory with Graph
  4. What breaks if you miss it
  5. Make expiry boring

Every Enterprise Application in Entra signs its tokens with a certificate. When that certificate expires, sign-ins stop. The good news is that Entra lets you stage a new certificate before you switch to it, so the whole thing can be done with zero downtime if the vendor cooperates.

  1. Create the new certificate (inactive)
  2. Send metadata to vendor
  3. Vendor trusts both certificates
  4. Make new certificate active
  5. Remove the old certificate
A calm rollover, planned around the expiry date.
  1. 01Create new certificate (inactive)
  2. 02Send metadata to vendor
  3. 03Vendor trusts both certificates
  4. 04Make new certificate active
  5. 05Remove the old one

Before the change

  • Check who receives expiry notifications under SAML Certificates → Notification email. Add a shared mailbox, not just one person.
  • Find out whether the vendor's side supports more than one trusted certificate at a time. This decides the whole plan.
  • Book a short window with the vendor contact if they don't.

The rollover

  1. In the app's Single sign-on blade, open SAML Certificates and choose Edit → New Certificate. Save it but leave it inactive.
  2. Download the new certificate (Base64) or the federation metadata XML and send it to the vendor.
  3. If the vendor supports two certificates: they add the new one alongside the old. You make the new one active whenever you like, then they remove the old one.
  4. If they support only one: agree a time, make the new certificate active in Entra, and have them swap theirs at the same moment. Test immediately.
  5. Test with a pilot user in a private browser window, then confirm a clean entry in the sign-in logs.
Can the vendor trust two signing certificates at once?
YesZero downtime: vendor adds the new cert, you switch any time, vendor removes the old one.
NoAgree a time; you activate the new cert and they swap theirs at the same moment.
Not sureAsk before you start. Plan for the second option until you know.
Your plan depends on what the vendor supports.

Quick inventory with Graph

To see what's coming up across the tenant, this lists with SAML signing keys and their expiry dates:

powershell
Connect-MgGraph -Scopes "Application.Read.All"

Get-MgServicePrincipal -All -Property DisplayName,KeyCredentials,PreferredSingleSignOnMode |
  Where-Object PreferredSingleSignOnMode -eq "saml" |
  ForEach-Object {
    foreach ($k in $_.KeyCredentials | Where-Object Usage -eq "Verify") {
      [pscustomobject]@{
        App     = $_.DisplayName
        Expires = $k.EndDateTime
        DaysLeft = [int]($k.EndDateTime - (Get-Date)).TotalDays
      }
    }
  } | Sort-Object DaysLeft | Format-Table
Note: the signing certificate shows up on the service principal as a Verify key credential alongside a matching Sign private key. Filtering on Verify gives one row per certificate.

What breaks if you miss it

When the active signing certificate expires, every SAML sign-in to that app fails. The vendor's error usually mentions an invalid signature, and users see a vendor error page rather than a Microsoft one, which can send troubleshooting down the wrong path. If an app suddenly fails for everyone, check the certificate first.

Make expiry boring

  • Add a shared mailbox as the certificate notification address on every SAML app
  • Keep a list of SAML apps, their vendor contacts and whether they support two certificates
  • Run the inventory script monthly, or schedule it in Azure Automation
  • Note each app's expiry date in your team calendar
Does creating a new certificate break anything?

No. A new certificate stays inactive until you make it active, so you can create it and share it with the vendor safely.

Can I set a longer lifetime?

You can choose the expiry when creating the certificate. Longer lifetimes mean fewer rollovers but a longer window if a key is ever compromised; three years is the default.

This post was last checked against Microsoft's documentation over six months ago. The approach should still hold, but check the linked sources for anything that has changed before you act on it.