Interview Prep/Azure/CI/CD and IaC

The Terraform plan for a small change shows the AKS cluster will be replaced. What do you do?

AdvancedScenarioCI/CD and IaC
Answer

Situation read → Stop. Find the ForceNew attribute before anything else.

What I'd do →

  1. Read the plan line marked # forces replacement
  2. Common causes: provider upgrade changing defaults, case differences in IDs, changed default_node_pool immutable fields, dns_prefix, network profile
  3. Fix: revert the field, add temporary_name_for_rotation for node pool changes, or use lifecycle { ignore_changes = [...] } for externally-managed fields
  4. Add prevent_destroy = true on the cluster resource in prod
  5. Re-run plan; proceed only when it shows in-place updates

Why → Replacing a cluster means downtime, new OIDC issuer, new IPs and lost PVs.

Interview tip → Mention prevent_destroy; it's a cheap seatbelt.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC