Stop Using the AKS Admin Kubeconfig
`az aks get-credentials --admin` is the handiest command in AKS and the one most likely to end up in an incident report. There's a better default, and switching costs nothing.
`az aks get-credentials --admin` is the handiest command in AKS and the one most likely to end up in an incident report. There's a better default, and switching costs nothing.
az aks get-credentials --admin is the command everyone reaches for because it
just works. It hands you a cluster-admin kubeconfig backed by a local account
and a static certificate. It also has three properties you do not want in
production: it's shared, it's not tied to a person, and it's hard to
revoke.
That certificate doesn't expire on a human timescale. Once it's on a few laptops, in a pipeline, in a Slack DM "just to unblock you," you've lost track of who can administer your cluster, and you can't surgically pull one person's access, because there's no "person" in the credential at all. When the audit asks "who had admin to prod," the honest answer is "unknown."
The fix is to stop minting that credential and use Entra ID integration with Kubernetes RBAC instead:
Then close the back door: disable local accounts on the cluster so the admin kubeconfig can't be minted at all. Break-glass access still exists by design. Just make it a deliberate, logged exception rather than the daily default.
You don't lose any capability. You trade a shared, unattributable, hard-to-revoke key for per-user, auditable, instantly-revocable access. The only thing you give up is the ability to say "I don't know who has admin," which was never an answer you wanted to give.
Want this distilled for your stack? Ask the assistant for the key takeaways or related reading.
Keep reading
A private cluster takes your API server off the public internet, a real security win that quietly breaks half your tooling. Go in knowing both halves.
Sathpal-OS