Runs an ARM/Bicep what-if operation against an existing resource group and returns the set of resource changes the deployment would produce — additions, modifications, deletions, and no-ops — without creating or modifying any resources. The template is supplied either inline (-TemplateFile), via URL (-TemplateUri), or by referencing a template spec (-TemplateSpecId). Template parameters can be supplied via file, URI, query string, or as Name=Value pairs through -Parameter.
Use -ResultFormat ResourceIdOnly for a compact summary, or -ResultFormat FullResourcePayloads (default) to include the full predicted resource bodies.
Examples
Preview a Bicep deployment before applying it
Run a what-if for main.bicep with parameter file main.parameters.json as deployment infra-prod-2026-06-18 against resource group myrg.
Deployment mode used to evaluate the change set. Use Incremental (default) to add and update resources, or Complete to also report resources in the resource group that aren't declared in the template.
Template parameters supplied as inline Name=Value pairs. Use this when you don't have a parameters file. Repeat the flag or pass an array for multiple values.
The format of the what-if results. Use FullResourcePayloads (default) to include the full predicted resource bodies, or ResourceIdOnly for a compact list of affected resource IDs.
Resource ID of an existing template spec to evaluate (for example, /subscriptions/.../providers/Microsoft.Resources/templateSpecs/<spec>/versions/<version>).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
A WhatIfOperationResult describing the changes the deployment would apply if executed. No resources are created or modified; the caller can inspect the change list before running the real deployment.
Notes
What-if is a read-only preview: it never creates or modifies resources. Use New-AzResourceGroupDeployment to apply the changes once the preview looks correct.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.