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 →
- Decide whether PRs should have Azure access at all (plan-only, Reader)
- If yes, add a separate federated credential for
pull_requeston a Reader-only identity - 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.
More on CI/CD and IaC
Design a GitHub Actions pipeline that builds an image, pushes to ACR and deploys to AKS with no secrets.IntermediateYour organisation uses Azure DevOps. Set up a secure deployment pipeline to AKS.IntermediateYou need to promote the same image from dev to staging to prod. How do you design it?IntermediateTerraform state for prod is in a storage account accessible with account keys. Harden it.IntermediateYour team wants to move from ARM JSON templates to Bicep. How do you migrate?BeginnerA pipeline needs to deploy to dev, test and prod in different subscriptions. How do you handle identities?Advanced