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/az-cli.md
1# az CLI adapter23Fast, portable, scriptable. Works anywhere `az` is installed and logged in.45## VM template67```bash8#!/usr/bin/env bash9set -euo pipefail1011# {plan-card-summary}1213az group create --name "{resourceGroup}" --location "{location}"1415az vm create \16--resource-group "{resourceGroup}" \17--name "{vmName}" \18--location "{location}" \19--image "{image}" \20--size "{vmSize}" \21--admin-username "{adminUsername}" \22--ssh-key-values @{sshKeyPath} \23--vnet-name "{vnetName}" \24--subnet "{subnetName}" \25--nsg "{nsgName}" \26--public-ip-address "{publicIpName}" \27--zone {zone} \28--os-disk-size-gb {osDiskSizeGb} \29--storage-sku {osDiskType} \30--tags {tagsKv}31```3233## VMSS template3435Replace `az vm create` with `az vmss create`, swap `--size` for `--vm-sku`, add `--instance-count {n}`, `--orchestration-mode Flexible`, `--upgrade-policy-mode Manual|Automatic|Rolling`.3637## Filled example — dev Linux VM in eastus3839```bash40#!/usr/bin/env bash41set -euo pipefail4243# dev-vm | eastus | Ubuntu2404 | Standard_D2s_v5 | new VNet | est. $70/mo4445az group create --name dev-vm-rg --location eastus4647az vm create \48--resource-group dev-vm-rg \49--name dev-vm \50--location eastus \51--image Ubuntu2404 \52--size Standard_D2s_v5 \53--admin-username azureuser \54--ssh-key-values @~/.ssh/id_rsa.pub \55--vnet-name dev-vm-vnet \56--subnet default \57--nsg dev-vm-nsg \58--public-ip-address dev-vm-ip \59--os-disk-size-gb 30 \60--storage-sku Premium_LRS \61--tags env=dev owner=team-name62```6364## Notes65- Windows VMs: swap `--ssh-key-values @...` for `--admin-password '{password}'`.66- Linux: prefer SSH keys (`~/.ssh/id_rsa.pub` or `~/.ssh/id_ed25519.pub`). Never paste private keys.67- `--zone` is optional; omit the flag entirely (don't pass empty) for regional VMs.68- `--tags` uses space-separated `k=v` pairs.69- Pre-check quota: `compute_vm_check-quota` (or `az vm list-usage --location {location} -o table`).70