Course contentsShow
← Cloud and Infrastructure
Lesson 917 of 2,98917. Azure ARM Templates and BicepFree lesson

Deployment What-If Operations

Preview changes before deployment with what-if operations to validate template effects without applying them.

Deployment What-If Operations

What you'll learn: How to preview the exact changes an ARM template will make to your Azure environment before actually deploying it.


What Are What-If Operations?

Think of what-if operations like using a flight simulator before piloting a real plane. Before you commit resources, time, and potentially disrupt production, you get a detailed preview of exactly what will happen when you deploy your ARM template—which resources will be created, modified, or deleted—without actually making any changes.

This is critical for avoiding surprises. Maybe you thought you were just updating a VM's size, but your template would actually delete and recreate it, causing downtime. What-if catches this before it happens.


How It Works

When you run a what-if operation (using Azure CLI or PowerShell), Azure analyzes your template against the current state of your resource group. It compares what exists now versus what your template declares, then generates a color-coded report:

  • Green (+): Resources that will be created
  • Orange (~): Resources that will be modified (with specific property changes listed)
  • Red (-): Resources that will be deleted
  • Gray (*): Resources that will remain unchanged

You're essentially validating your template's effects without applying them—similar to how you validated syntax earlier with template validation, but now checking the actual infrastructure impact.


Why This Matters

What-if operations are your safety net. They help you:

  • Catch unintended deletions or destructive changes
  • Verify dependency ordering before deployment
  • Build confidence in template changes
  • Document expected changes for approval processes

Key Takeaway: What-if operations let you preview ARM template changes before deployment, showing exactly which resources will be created, modified, or deleted—turning deployment from guesswork into informed decision-making.