Interview Prep/DevSecOps/Cloud identity: IRSA, Workload Identity and CI OIDC

After recreating an AKS cluster, pods fail with `AADSTS700211: No matching federated identity record found for presented assertion issuer`

AdvancedTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer

Likely causes → Every AKS cluster has its own OIDC issuer URL. The federated identity credentials on the managed identity still point at the old cluster's issuer.

Diagnose →

az aks show -g rg -n prod --query oidcIssuerProfile.issuerUrl -o tsv
az identity federated-credential list -g rg --identity-name api-id -o table

Fix →

az identity federated-credential create -g rg --identity-name api-id --name prod-api \
  --issuer "$(az aks show -g rg -n prod --query oidcIssuerProfile.issuerUrl -o tsv)" \
  --subject system:serviceaccount:prod:api --audiences api://AzureADTokenExchange

Prevent → Make federated credentials depend on the cluster's issuer output in Terraform, so a rebuild updates them. For blue/green clusters, add a credential for each.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud identity: IRSA, Workload Identity and CI OIDC