Exam objective
Define Azure infrastructure as code using Bicep and validate changes with what-if before applying them
(Design and implement build and release pipelines — 50–55%)
Closes #163.
Read first
What to build
An infra/main.bicep file that describes the full TimeTracker Azure infrastructure — App Service Plan, App Service, Azure SQL Server + Database, and App Configuration store — such that running it against the existing resource group makes no changes (idempotent).
Your task
- Install the Bicep CLI:
az bicep install && az bicep version
- Export the existing resources to ARM JSON:
az group export --name <resource-group> > infra/existing.json
- Decompile to Bicep:
az bicep decompile --file infra/existing.json — this creates infra/existing.bicep
- Clean up the generated file: remove auto-generated noise, extract credentials to
@secure() parameters, rename resources to be descriptive
- Run
az deployment group what-if --resource-group <rg> --template-file infra/main.bicep — fix any warnings until it shows "No change"
- Add a GitHub Actions workflow step that runs
what-if on every PR that modifies infra/**, posting the output as a PR comment
Explore
# Validate the Bicep file compiles without errors:
az bicep build --file infra/main.bicep
# Run the Bicep linter:
az bicep lint --file infra/main.bicep
# Convert back to ARM JSON to see what Bicep generates:
az bicep build --file infra/main.bicep --outfile /tmp/arm.json
cat /tmp/arm.json | jq '.resources[].type'
# Open the Bicep playground at aka.ms/bicepdemo and paste your Bicep — verify the ARM JSON it generates
Exam checkpoint
- What is the difference between ARM templates and Bicep?
- What does
az deployment group what-if do and why is it useful in CI?
- What is a Bicep module and when would you extract one?
- How do you handle secrets (SQL passwords, connection strings) in Bicep without hardcoding them?
- What is the difference between
az deployment group create (deploy) and what-if (preview)?
Exam objective
Closes #163.
Read first
What to build
An
infra/main.bicepfile that describes the full TimeTracker Azure infrastructure — App Service Plan, App Service, Azure SQL Server + Database, and App Configuration store — such that running it against the existing resource group makes no changes (idempotent).Your task
az bicep install && az bicep versionaz group export --name <resource-group> > infra/existing.jsonaz bicep decompile --file infra/existing.json— this createsinfra/existing.bicep@secure()parameters, rename resources to be descriptiveaz deployment group what-if --resource-group <rg> --template-file infra/main.bicep— fix any warnings until it shows "No change"what-ifon every PR that modifiesinfra/**, posting the output as a PR commentExplore
Exam checkpoint
az deployment group what-ifdo and why is it useful in CI?az deployment group create(deploy) andwhat-if(preview)?