Workload identity federation lets a pipeline exchange its own signed OIDC token for a Microsoft Entra ID token, so no client secret is stored anywhere. The app registration holds a federated credential that trusts one issuer and one subject.
That subject is the whole security boundary. Anything that can present a token from that issuer with that subject gets the identity, and every permission attached to it.
Keep subjects as narrow as the job that needs them:
- GitHub Actions: prefer
repo:my-org/infra:environment:productionover a branch-wide or repository-wide subject, so only jobs that target the protected environment can deploy. - HCP Terraform: the subject includes the workspace and run phase (
organization:…:workspace:azure-network:run_phase:apply), so plan and apply can use different identities: read-only for plan, write for apply. - One credential per pipeline. A single app registration trusted by many pipelines makes the weakest pipeline the boundary for all of them.
Federation removes the secret, not the trust. Anyone who can edit the pipeline definition, or run it from an unprotected branch, can still use the identity. Protect pipeline edits and deployment branches as carefully as you used to protect the secret.
Audit: list the federated credentials on each app registration and check every subject against the one pipeline that should hold it.
More context: Azure identity as code and credential-free pipelines