Your Terraform pipeline needs to create role assignments, but it only has Contributor. What do you change?
IntermediateScenarioIdentity, Access and Governance
Answer
Situation read → Contributor excludes Microsoft.Authorization/roleAssignments/write. Give the minimum extra right.
What I'd do →
- Add
Role Based Access Control Administratorfor the pipeline identity at the RG scope, with a condition restricting assignable roles (AcrPull, Key Vault Secrets User, Network Contributor) - Do not grant Owner or User Access Administrator unrestricted
- Re-run the pipeline and check that the
azurerm_role_assignmentresources succeed - Record the exception in the platform's RBAC register
Why → Pipelines that can grant any role are a privilege escalation path for anyone who can edit the pipeline.
Interview tip → Ask "who can change the pipeline?" — that person effectively holds the pipeline's rights.
More on Identity, Access and Governance
A new developer joins and needs to deploy to the dev resource group only. How do you give access?BeginnerYour GitHub Actions workflow uses a client secret stored in a repo secret. Security wants it gone. What do you do?BeginnerAuditors ask "who has Owner on production, and why?" How do you answer and fix it?IntermediateA VM application needs to read blobs from one container. How do you set up access without keys?IntermediateTeams keep creating resources in random regions and without tags. How do you stop it?BeginnerA contractor needs temporary read access to logs for two weeks. How do you handle it?Beginner