Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Get Azure VM and VM Scale Set recommendations based on workload, performance, and budget needs.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
workflows/vm-creator/references/output-adapters/bicep.md
1# Bicep adapter23Production IaC, repeatable deployments, supports `az deployment group what-if` preview before commit.45## Template67Emit [`examples/bicep/main.bicep`](../../examples/bicep/main.bicep) alongside the README. Single-file template — no modules to wire. Parameters (`vmName`, `adminUsername`, `adminPublicKey` required; others have defaults).89Always emit `examples/bicep/README.md` next to the template so the artifact is self-contained (Plan Card, prereqs, quickstart, parameter table, cleanup).1011## Deploy1213```bash14az deployment group what-if \15--resource-group {resourceGroup} \16--template-file main.bicep \17--parameters vmName={vmName} adminUsername={adminUsername} \18adminPublicKey="$(cat ~/.ssh/id_rsa.pub)"1920az deployment group create \21--resource-group {resourceGroup} \22--template-file main.bicep \23--parameters vmName={vmName} adminUsername={adminUsername} \24adminPublicKey="$(cat ~/.ssh/id_rsa.pub)"25```2627Always run `what-if` first — it's free and surfaces any quota / role / naming conflict before the change lands.2829## VMSS3031Swap `Microsoft.Compute/virtualMachines@2024-07-01` for `Microsoft.Compute/virtualMachineScaleSets@2024-07-01`. Add `sku: { name: vmSize, capacity: instanceCount }`, `properties.orchestrationMode: 'Flexible'`, and move `osProfile` / `storageProfile` / `networkProfile` inside `properties.virtualMachineProfile`.3233## Notes34- Secure params (`adminPassword`, `adminPublicKey`) are `@secure()`; don't echo them in logs.35- For `zone`, pass `'1'`/`'2'`/`'3'` to pin a zone, or `''` for regional. The template handles both via `empty(zone) ? null : [zone]`.36- For private VMs, set `publicIPAllocationMethod` to nothing and drop the `publicIPAddress` block from the NIC.37