Interview Prep/Azure/CI/CD and IaC

Your pipeline's Azure login works on `main` but fails on pull requests. Why, and what should you do?

IntermediateScenarioCI/CD and IaC
Answer

Situation read → The federated subject differs on PRs (repo:org/repo:pull_request), and that's often intentional.

What I'd do →

  1. Decide whether PRs should have Azure access at all (plan-only, Reader)
  2. If yes, add a separate federated credential for pull_request on a Reader-only identity
  3. Never give PR workflows deploy identities; forks can submit PRs

Why → PR code is untrusted until merged; its token should not deploy anything.

Interview tip → Saying "PRs get a read-only identity" shows security thinking.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC