You need to apply Azure Policy definitions themselves as code. How?
IntermediateScenarioCI/CD and IaC
Answer
Situation read → Policy-as-code repo, deployed by pipeline, tested in a sandbox management group.
What I'd do →
- Store definitions, initiatives and assignments in git (Bicep, Terraform
azurerm_policy_definition, or the EPAC tool) - Pipeline deploys to a test management group first, runs compliance checks
- Promote to production management groups with approval
- New deny policies start in Audit (or with
enforcementMode: DoNotEnforce)
Why → Policies can break every team at once; they deserve the same review and staging as code.
Interview tip → enforcementMode: DoNotEnforce lets you see impact without blocking.
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