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

`azure/login` in GitHub Actions fails with `AADSTS700213: No matching federated identity record found for presented assertion subject 'repo:acme/api:environment:prod'`

BeginnerTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer

Likely causes → The federated credential on the app registration or managed identity was created for "Branch: main" (repo:acme/api:ref:refs/heads/main), but the job runs with environment: prod, which changes the subject.

Diagnose → Compare the error's subject with az ad app federated-credential list --id <app-id>.

Fix → Add a federated credential with subject repo:acme/api:environment:prod, and keep permissions: id-token: write on the job.

Prevent → Document the subject format per job type in your CI template and create the credentials from it.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

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