← Back to Cards

Bicep Essentials

File Extension.bicep — transpiles to ARM JSON
Resourceresource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01'
Parametersparam location string = resourceGroup().location
Variablesvar storageName = 'st${uniqueString(resourceGroup().id)}'
Modulesmodule vnet './modules/vnet.bicep' = { ... }
Deployaz deployment group create --template-file main.bicep

Terraform Essentials

File Extension.tf — HCL syntax
Resourceresource "azurerm_resource_group" "rg" { ... }
Variablesvariable "location" { default = "uksouth" }
Outputsoutput "rg_id" { value = azurerm_resource_group.rg.id }
StateRemote state in Azure Storage Account or Terraform Cloud
Commandsterraform init → plan → apply → destroy

Bicep vs Terraform Comparison

ProviderBicep: Azure-only | Terraform: Multi-cloud
StateBicep: Managed by Azure | Terraform: Explicit state file
LanguageBicep: Bicep DSL | Terraform: HCL
ModulesBicep: Registry/local | Terraform: Registry/local/Git
CI/CDBoth integrate with Azure DevOps and GitHub Actions
Learning CurveBicep: Lower for Azure-only | Terraform: Broader ecosystem