Azure Bicep — Infrastructure as Code
Deploy Azure resources consistently with Azure Bicep — Microsoft's native IaC language that compiles to ARM templates with a clean, readable syntax.
“Welcome back. Today we cover Azure Bicep, Microsoft's native Infrastructure as Code language for Azure. If you've been clicking through the portal to create resources, you're accumulating technical debt — environments drift, deployments aren't repeatable, and you can't version control what you built. Bicep solves this by letting you define your Azure infrastructure in code, just like application code.”
“Infrastructure as Code transforms how you manage cloud environments. Without IaC, environments drift — Dev has one config, Prod has another, and nobody knows why. With IaC, your infrastructure is defined in files checked into git. Every change goes through pull request review. You can deploy identical environments for Dev, Test, and Prod. If disaster strikes, you redeploy from code in minutes. This is how professional cloud teams operate.”
“Three main IaC options for Azure: ARM templates are the original Azure IaC — JSON files that are verbose and hard to write. Bicep is Azure's answer — it compiles down to ARM but with a dramatically cleaner syntax. No state files to manage; Azure itself is the source of truth. Terraform is HCL-based, multi-cloud, and has a large ecosystem. If you're Azure-only, Bicep is the simplest path. If you're managing multiple clouds or your team already knows Terraform, that's valid too.”
“Bicep syntax is clean and readable. You declare resources using the resource keyword, giving it a name, type, and API version. Parameters let callers pass in values — environment name, location, SKU. Variables compute values within the template. Outputs return values after deployment — like the storage account connection string or the app service URL. Modules let you split large templates into reusable components, like a network module that creates VNet, subnets, and NSG together.”
“Modules are the key to maintainable Bicep at scale. Break your infrastructure into logical modules — a network module, a compute module, a data module — and compose them in a main.bicep file. Use parameter files to provide environment-specific values without changing the template. The Bicep Registry lets you publish and share modules across your organization, so teams build on validated, approved infrastructure patterns. Always use what-if deployments in pipelines before actually deploying to production.”
“The real power of Bicep comes from integrating it into CI/CD pipelines. On a pull request, run a Bicep what-if deployment and post the results as a PR comment — reviewers see exactly what Azure resources will change. On merge to main, automatically deploy to Dev. Promote to Test and Prod through pipeline stages with manual approval gates. Your entire Azure environment lifecycle — creation, changes, deletion — flows through code review and automated pipelines.”
“The honest answer on Bicep vs Terraform: if you're Azure-only and starting fresh, Bicep is the simplest path with the best Azure day-zero support. If your team already has Terraform expertise or manages multiple clouds, stick with Terraform. Microsoft officially supports both and provides good tooling for each. Some organizations use both — Terraform for cross-cloud resources like DNS and Bicep for Azure-specific services. Don't overthink it; the best IaC tool is the one your team will actually use consistently.”
“Azure Bicep transforms your Azure infrastructure from a set of portal clicks into version-controlled, reviewable, repeatable code. Start small — convert one resource group to Bicep — and grow from there. Next episode we cover Azure Logic Apps and Power Automate for workflow automation without writing full application code.”
- 1Install Bicep CLI: az bicep install
- 2Create a simple Bicep file to deploy a Storage Account
- 3Run: az deployment group create --template-file main.bicep
- 4Show the compiled ARM JSON using: az bicep build
- 5Add parameters and variables to the template
- 6Deploy a VNet + Subnet + NSG using a Bicep module
- 7View deployment in Azure Portal under Resource Group > Deployments