fINTERACTIVE FIELD GUIDES
Troubleshooting27 / 30

Workload ID Troubleshooting

Trace authentication from pod mutation through token exchange to target-resource authorization.

Learning status: Not practiced

Follow the flow in order. Change one boundary at a time and avoid printing token values.

SymptomCheck
Azure variables or token file missingPod template has azure.workload.identity/use: "true"; pod uses the intended service account; webhook is healthy; inspect the admitted Pod, not only the Deployment
Entra rejects the assertionFIC issuer equals the cluster issuer exactly; subject is system:serviceaccount:<namespace>:<service-account>; audience is api://AzureADTokenExchange
Works after delay, fails immediately after setupFIC propagation can take a short time; retry after propagation
SDK reports unsupported credential or missing variablesUse a current Azure Identity package; confirm the pod was mutated and AZURE_FEDERATED_TOKEN_FILE is set
Token succeeds, Azure API returns 403Identity federation succeeded; inspect role assignment, data-plane role, authorization model, and scope on the target resource
Kubernetes API returns ForbiddenThis is Kubernetes control-plane authorization, not Azure data-plane authorization
Image pull fails before app startsInspect the node's kubelet identity and ACR permissions, not the pod Workload ID

Useful checks:

kubectl get pod <pod> -n <namespace> -o yaml
kubectl describe pod <pod> -n <namespace>
kubectl get serviceaccount <service-account> -n <namespace> -o yaml
az aks show --resource-group <resource-group> --name <cluster> \
  --query oidcIssuerProfile.issuerUrl --output tsv

Do not dump AZURE_FEDERATED_TOKEN_FILE contents into logs, terminals, tickets, or build output.

Sources: AKS Workload ID overview, configure AKS Workload ID.