Interview Prep/Azure/AKS and ACR Errors

Pods with workload identity fail: `WorkloadIdentityCredential authentication failed ... AADSTS70021: No matching federated identity record found for presented assertion. Assertion Subject: 'system:serviceaccount:shop:default'.`

IntermediateTroubleshootingAKS and ACR Errors
Answer

Likely causes → The pod uses the default ServiceAccount instead of the federated one, or the namespace/SA name differs from the credential subject.

Diagnose →

kubectl get pod <pod> -n shop -o jsonpath='{.spec.serviceAccountName}'
az identity federated-credential list --identity-name id-orders -g rg --query "[].subject"

Fix → Set serviceAccountName: orders-sa in the pod spec, or create a federated credential for the actual subject.

Prevent → Helm chart values that tie SA name and federation subject together.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on AKS and ACR Errors