How do you test Bicep or Terraform modules before teams consume them?
AdvancedScenarioCI/CD and IaC
Answer
Situation read → Static checks, then real deployments in a test subscription.
What I'd do →
- Static:
bicep lint/ PSRule for Azure,terraform validate,tflintwith azurerm ruleset, Checkov - Unit-ish:
terraform testwithcommand = planassertions - Integration:
terraform testwithcommand = applyin a sandbox subscription, assertions on outputs, auto-destroy - Publish versioned releases (Bicep registry, git tags) only after tests pass
Why → Module bugs multiply across every consumer; tests catch them once.
Interview tip → Mention PSRule for Azure; it maps to Well-Architected rules.
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