Key takeaways
- Every credential follows the same four-stage lifecycle: create, distribute, cut over, and retire.
- Entra ID app registrations support two active client secrets, enabling zero-downtime dual-secret cutover.
- Key Vault never rotates secrets itself; it fires SecretNearExpiry events that trigger your Azure Function.
- Adding a Key Vault secret version is not revocation, so old versions stay valid until their own expiry.
- Track owner, expiry, trigger, and automation path for every credential in one metadata-only rotation map.
Azure secret rotation works end to end by treating every credential the same way: an owner, an expiry date, a rotation trigger, and an automation path. That covers Entra ID client secrets, Key Vault secrets, AKS credentials, and database credentials your Azure workloads call into. Per-service docs cover each in isolation; the hard part is sequencing them in one lifecycle so nothing expires unowned.
What is secret rotation?
Secret rotation is the scheduled replacement of credentials like API keys, client secrets, and database passwords so that any single credential has a bounded lifetime. Rotation limits the blast radius of a leaked key and satisfies audit requirements.
Rotation vs expiry vs revocation
These three get conflated, and the confusion causes outages. Expiry is when a credential stops working on a fixed date. Revocation is killing a credential immediately, usually after an incident. Rotation is issuing a replacement and updating consumers before the old value dies. Entra ID client secrets, for example, can be created with a maximum lifetime of up to two years, so expiry alone is not a rotation policy (Microsoft Entra ID documentation on app registration client secrets).
Why 30/60/90 day rotation policies exist
Short-lived creds are the goal, but long-lived keys persist across AWS, Stripe, and GitHub. A 30/60/90 day policy caps how long a stolen key stays valid and gives auditors a defensible answer. The hard part is not the interval; it is tracking who owns each key and whether the rotation actually happened, which most teams still do in a spreadsheet (alternatives to manual credential rotation tracking).
How does Azure secret rotation work end to end?
Rotation is not one event. Every credential in your estate moves through the same four stages, and most incidents happen in the gaps between them.
The four stages: create, distribute, cut over, retire
Create. A new secret or key is generated: an Entra ID client secret, a Key Vault secret version, a database password. It gets an expiry date at creation, or it should.
Distribute. The new version lands where workloads read it. If your app pulls from Key Vault at runtime, this is cheap. If a human pastes it into a Postman collection or a pipeline variable, you have secrets sprawl before day one.
Cut over. Workloads switch to the new version. Dual-validity windows matter here: keep the old version readable until every consumer has picked up the new one, then flip.
Retire. The old version is disabled and deleted, with an audit trail showing who did what and when.
Where humans stay in the loop (and how to remove them)
The failure point is rarely the vault. It is the handoff: a dev who owns a Stripe key nobody else knows about, a rotation deadline in someone's head instead of a tracker. Event Grid-triggered Azure Functions can handle the mechanical rotation, but ownership and expiry metadata still needs a home. That is the layer KeyGuardRail adds on top of vaults like HashiCorp Vault (how it compares): track who owns each credential, when it expires, and what happens next, without holding the secret value itself.
How do you rotate Entra ID client secrets?
Entra ID app registrations support two active client secrets at once, which is what makes rotation a non-event instead of an outage. The pattern: add a new secret, migrate every consumer to it, then delete the old one before its expiry date.
Adding a new secret before the old one expires
In the Entra portal, open App registrations, select your app, then Certificates & secrets, and create a new client secret with a custom expiry. Note the secret value immediately; it is shown once. Track the new expiry date against the app's owner right away, because Entra will not chase anyone for you. If you rely on reminders, a credential expiration tracker keeps ownership and deadlines out of a spreadsheet (credential expiration reminder tools for IT teams).
Dual-secret cutover for apps and CI/CD
Update each consumer one at a time: app config, GitHub Actions secrets, then any Postman collections or local .env files where secrets sprawl tends to hide. Verify each consumer authenticates with the new secret before moving on. Only after every consumer is cut over should you delete the old secret, and record the deletion in your audit trail.
Why 24-month defaults are a trap
The default 24-month expiry is long enough that nobody remembers the secret exists until it breaks. Set 90-day expiries instead, matching a 30/60/90 day rotation policy, so rotation becomes routine. Microsoft's own guidance pairs near-expiry events with automated rotation workflows (Key Vault rotation documentation).
How do you automate Key Vault secret rotation?
Key Vault rotation has two moving parts: an expiry policy on the secret, and something that reacts when that expiry approaches. Key Vault itself never rotates a value; it stores versions and raises events. The rotation logic is yours to write.
Setting an expiry policy on the secret
Every secret accepts an exp attribute. Set it at creation time, and enforce it with an Azure Policy so a secret without an expiry fails deployment. A 30/60/90 day rotation policy only works if every secret actually has a deadline attached. For a worked set of expiry intervals by credential type, see API key expiration policy examples.
Event Grid near-expiry events plus a rotation Azure Function
Subscribe to the SecretNearExpiry event on your vault and route it to an Azure Function. The function generates the new value, calls the upstream provider (Stripe, a database, an Entra app), writes the new version to Key Vault, and updates consumers. Key Vault's own docs recommend exactly this Event Grid-plus-Function pattern.
The part that bites teams later: rotation is versioning, not revocation. Adding a version leaves every old version valid until its own expiry, so a leaked key from three rotations ago still works unless you explicitly disable or purge it. Anything tracking ownership and rotation deadlines lives outside Key Vault, since the vault holds values and metadata but no coordination layer for who owns the credential and when it is due.
How do you rotate Kubernetes and AKS credentials?
Secrets Store CSI Driver with Key Vault as the source
Mount secrets from Key Vault into pods via the Secrets Store CSI Driver instead of writing them into Kubernetes Secrets. When Key Vault holds a new version, the driver can update the mounted file on its rotation poll interval, so the pod filesystem always reflects the latest value. The catch: most apps read env vars or config at startup, so a fresh file alone changes nothing until the process reloads.
Rolling restarts to pick up new values
The reliable pattern is a trigger-and-restart loop: an Event Grid subscription fires an Azure Function when a Key Vault secret nears expiry, the Function updates the secret, and a Kubernetes annotation change (or a kubectl rollout restart) forces pods to consume the new version. Microsoft documents this Event Grid-triggered flow in its tutorial on rotating a Key Vault secret with an Azure Function.
Service account tokens and kubeconfig certs
Workload identity short-lived tokens handle most pod-to-Azure calls, but kubeconfig client certificates and long-lived service account tokens still expire on their own schedules. Track who owns each cert, its expiry date, and the rotation deadline outside the cluster, since Kubernetes will happily keep serving expired credentials until something breaks. We map that ownership and expiry metadata without holding the secret value itself — see how at KeyGuardRail's security model.
How do you rotate RDS and database credentials from Azure workloads?
AWS Secrets Manager rotation Lambdas for RDS
RDS integrates with AWS Secrets Manager so a rotation Lambda runs on your 30/60/90 day schedule, creates a new password, applies it to the database, and updates the secret. The Lambda is the transport layer, not your engineers. If your Azure app pulls the credential from Secrets Manager at startup or via a cached read, the next fetch picks up the new value.
Dual-user rotation pattern
RDS rotation uses two database users: it changes one while the other stays live, then swaps. That means a rotation never locks out an active connection mid-request. Your Azure workload should tolerate a credential changing underneath it, which usually means re-reading the secret on auth failure instead of caching it for days.
Pointing Azure workloads at cross-cloud secrets
The gap is ownership and expiry visibility. Your rotation policy lives in AWS, your app lives in Azure, and nobody on the platform team knows which service breaks if a rotation deadline slips. Track the secret's owner, next expiry, and consuming services in one place, even if the secret value stays in Secrets Manager.
What does a cross-service rotation map look like?
A rotation map is one table where every credential, regardless of provider, shows the same four fields: owner, expiry, trigger, and automation path. Once Entra ID client secrets, Key Vault secrets, AKS credentials, and Stripe keys sit in one sequence, you can see which rotation deadline lands next and who is accountable for it.
The rotation map: owner, expiry, trigger, automation path
| Credential | Owner | Expiry | Trigger | Automation path |
|---|---|---|---|---|
| Entra ID client secret | Payments platform | 90 days | Calendar deadline | Azure Function via Event Grid |
| Key Vault secret | Platform engineering | 60 days | Event Grid near-expiry event | Function rewrites secret |
| AKS CSI-mounted secret | Infrastructure | 60 days | Pod restart / driver refresh | Secrets Store CSI Driver re-polls Key Vault |
| Stripe API key | Payments platform | 90 days | Calendar deadline | Manual rotate, then update vault |
The CSI driver row matters: mounted secrets refresh on pod restart, so an expiry nobody tracks means a workload running on stale values.
Tracking metadata without holding secret values
The map needs metadata only: names, owners, expiry dates, and triggers. Secret values stay in your vault, whether that is AWS Secrets Manager, HashiCorp Vault, or Infisical. A lifecycle layer that never takes custody of values avoids becoming a second vault to audit.
How KeyGuardRail handles this (run through the same criteria)
KeyGuardRail builds exactly this map: it monitors credential expiry and ownership across AWS and SaaS providers like Stripe and GitHub, holding metadata rather than secret values. It tracks the deadlines and sends reminders; the rotation itself runs through your existing vault and automation. Self-serve signup, Starter tier, owners like "Payments platform" and "Platform engineering" map directly to the table above.
How do Azure and AWS secret rotation compare?
Native rotation features side by side
Azure gives you Event Grid near-expiry events plus Azure Functions to rotate Key Vault secrets, and Entra ID client secrets with a hard expiry you set at creation. AWS gives you Secrets Manager rotation lambdas on a schedule, IAM access keys with rotation via policy, and short-lived STS creds by default. The mechanics differ, but both stop at execution: neither tells you who owns a credential, when it expires, or whether the 30/60/90 day rotation policy is actually being met across services.
What a multi-cloud team standardizes on
Run the same lifecycle map in both clouds: every credential gets an owner, an expiry date, and a rotation deadline, regardless of how the rotation fires. Use short-lived creds wherever the provider supports them, and treat the vault (Secrets Manager, Vault, Infisical) as storage, not coordination. KeyGuardRail tracks that metadata only — ownership, expiry, rotation deadlines across AWS, Azure, and SaaS providers like Stripe and GitHub — without holding secret values, so the same audit trail covers both clouds. Doppler, HashiCorp Vault, and Akeyless also operate across providers; Clutch Security focuses on the non-human credential side. Pick the coordination layer once and apply it everywhere.
FAQ
Does Azure Key Vault rotate secrets automatically?
No. Key Vault stores secret versions and fires SecretNearExpiry events via Event Grid, but the rotation logic is yours to write, typically an Azure Function that generates a new value and writes it as a new version. Adding a version is not revocation either: old versions stay valid until their own expiry unless you disable or purge them.
How often should I rotate client secrets in Azure AD?
Set 90-day expiries instead of accepting the 24-month default, which is long enough that nobody remembers the secret exists until it breaks. Entra ID supports two active client secrets per app registration, so add the new one, migrate every consumer, then delete the old value before expiry. Rotation becomes routine rather than an outage.
What happens to running apps when a secret is rotated?
It depends on how they consume it. Apps pulling from Key Vault at runtime pick up new versions on their next read, and CSI-mounted files refresh on the driver's poll interval. Most apps read config at startup, though, so a rolling restart or kubectl rollout restart is usually required before pods actually use the new value.
Can I rotate secrets with a Lambda function like AWS does?
Not directly, since Lambda is AWS. The Azure equivalent is an Azure Function triggered by Event Grid's SecretNearExpiry event. The function generates the new value, calls the upstream provider, writes the new version to Key Vault, and updates consumers. For RDS specifically, AWS Secrets Manager's rotation Lambda handles the database side, and your Azure app just re-fetches the credential.
How do I track who owns each secret and when it expires?
Vaults hold values and metadata but no coordination layer, so ownership and deadlines usually end up in a spreadsheet. Track four fields per credential in one place: owner, expiry, trigger, and automation path. KeyGuardRail does this while holding metadata only, never the secret values, so the vault remains the single store of actual credentials.
