Setting it up
Certificates
Creating the credential, and rotating it before it expires.
The application authenticates with a certificate rather than a client secret. A secret in an environment variable is a secret in a shell history, a backup and a screenshot; a certificate’s private key stays on the host.
Creating one
Section titled “Creating one”scripts/new-graph-certificate.sh produces a key, a self-signed certificate and a PKCS#12 bundle.
Upload the public certificate to the app registration; keep the bundle and its password in the
deployment’s secrets directory, readable only by the service account.
Self-signed is correct here. The certificate is not proving an identity to the public internet — it is proving to Entra that the holder is the registration it says it is, and Entra checks the thumbprint it was given rather than a chain.
Rotating one
Section titled “Rotating one”Rotation is additive, which is what makes it safe:
- Create the new certificate and upload it beside the old one. A registration may hold several.
- Point the deployment at the new bundle and restart.
- Confirm with
scripts/verify-graph-certificate.sh. - Remove the old certificate from the registration.
At no point is there a moment with no valid credential. The dashboard warns as expiry approaches, with thresholds on the monitoring settings, because the failure mode of a forgotten certificate is a deployment that stops entirely at a date nobody wrote down.