How does a pod in AKS get an Entra token with workload identity?
AdvancedConceptEntra ID, RBAC and Identities
Answer
- The cluster has the OIDC issuer and workload identity features enabled.
- A user-assigned identity has a federated credential with
issuer = <cluster OIDC URL>andsubject = system:serviceaccount:<ns>:<sa>. - The ServiceAccount is annotated
azure.workload.identity/client-id: <clientId>and the pod has labelazure.workload.identity/use: "true". - The mutating webhook injects
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_FEDERATED_TOKEN_FILEand a projected SA token volume. - The Azure SDK (
DefaultAzureCredential/WorkloadIdentityCredential) exchanges the projected token for an Entra token.
No node-level identity is shared between pods, which is why it replaced the deprecated AAD Pod Identity.
More on Entra ID, RBAC and Identities
What is Microsoft Entra ID and how is it different from on-prem Active Directory?BeginnerWhat is the difference between an app registration and a service principal?BeginnerWhat is a managed identity and what problem does it solve?BeginnerSystem-assigned vs user-assigned managed identity: when do you use each?IntermediateHow does Azure RBAC evaluate access?IntermediateName the core built-in roles and the difference between Owner, Contributor and User Access Administrator.Beginner