Roadmap › Azure DevOps & CI/CD › Module: Azure Pipelines
Lessons in this course (10)

9. Infrastructure as Code in pipelines

IntermediateMediumLesson 9 of 10
yaml
- task: AzureCLI@2
  inputs:
    azureSubscription: sc-shop-prod
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: |
      az deployment group what-if -g rg-shop-prod -f infra/main.bicep -p env=prod
      az deployment group create  -g rg-shop-prod -f infra/main.bicep -p env=prod
  • Bicep (Azure-native, compiles to ARM JSON), ARM templates, Terraform (multi-cloud, state file in Azure Storage with locking), Pulumi.
  • Practices: plan/what-if on PR, apply after approval, store state securely, use modules, separate environments by parameters, detect drift.