Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Validate Azure configurations, ARM/Bicep templates, and resource settings before deployment
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/recipes/azcli/README.md
1# AZCLI Validation23Validation steps for Azure CLI deployments.45## Prerequisites67- `./infra/main.bicep` exists8- Docker available (if containerized)910## Validation Steps1112- [ ] 1. Azure CLI Installation13- [ ] 2. Authentication14- [ ] 3. Bicep Compilation15- [ ] 4. Template Validation16- [ ] 5. What-If Preview17- [ ] 6. Docker Build (if containerized)18- [ ] 7. Azure Policy Validation1920## Validation Details2122### 1. Azure CLI Installation2324Verify Azure CLI is installed:2526```bash27az version28```2930**If not installed:**31```32mcp_azure_mcp_extension_cli_install(cli-type: "az")33```3435### 2. Authentication3637```bash38az account show39```4041**If not logged in:**42```bash43az login44```4546**Set subscription:**47```bash48az account set --subscription <subscription-id>49```5051### 3. Bicep Compilation5253```bash54az bicep build --file ./infra/main.bicep55```5657### 4. Template Validation5859```bash60# Subscription scope61az deployment sub validate \62--location <location> \63--template-file ./infra/main.bicep \64--parameters ./infra/main.parameters.json6566# Resource group scope67az deployment group validate \68--resource-group <rg-name> \69--template-file ./infra/main.bicep \70--parameters ./infra/main.parameters.json71```7273### 5. What-If Preview7475```bash76# Subscription scope77az deployment sub what-if \78--location <location> \79--template-file ./infra/main.bicep \80--parameters ./infra/main.parameters.json8182# Resource group scope83az deployment group what-if \84--resource-group <rg-name> \85--template-file ./infra/main.bicep \86--parameters ./infra/main.parameters.json87```8889### 6. Docker Build (if containerized)9091**Before building**, validate the Docker build context:92931. Read the `Dockerfile` in `./src/<service>`942. If the Dockerfile contains `npm ci`, verify `package-lock.json` exists in the same directory953. If `package-lock.json` is missing, generate it:9697```bash98cd ./src/<service>99npm install --package-lock-only100```101102**Then build:**103104```bash105docker build -t <image>:test ./src/<service>106```107108### 7. Azure Policy Validation109110See [Policy Validation Guide](../../policy-validation.md) for instructions on retrieving and validating Azure policies for your subscription.111112## References113114- [Error handling](./errors.md)115116## Next117118All checks pass → **azure-deploy**119