Security wants all Azure resource changes in prod to go through code. How do you enforce it?
AdvancedScenarioIdentity, Access and Governance
Answer
Situation read → Remove human write paths, keep a break-glass path, and detect drift.
What I'd do →
- Give humans Reader in prod; write roles only via PIM with approval for emergencies
- Pipelines deploy with federated identities from protected branches and environments with approvals
- For Bicep, use deployment stacks with
--deny-settings-mode denyWriteAndDelete, excluding the pipeline and break-glass identities - Nightly drift detection (
terraform plan -detailed-exitcodeorwhat-if) that opens a ticket on changes - Alert on Activity Log writes in prod by any caller that isn't the pipeline identity
Why → Enforcement plus detection: PIM handles emergencies, everything else is reviewed in PRs.
Interview tip → Always keep a break-glass path in the answer; "nobody can change prod" is not a real design.
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