Portal changes keep drifting from Terraform. How do you get control back?
IntermediateScenarioCI/CD and IaC
Answer
Situation read → Detect, decide, prevent.
What I'd do →
- Nightly
terraform plan -detailed-exitcodejob; exit code 2 posts the diff to the team channel - For each drift: codify in Terraform or revert by applying
- Reduce human write access in prod; PIM for emergencies
- Azure Policy deny/modify for the properties people keep changing (TLS version, public access)
Why → Detection alone doesn't stop drift; removing the write path does.
Interview tip → Mention terraform apply -refresh-only for accepting harmless drift into state.
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