Asks Azure Resource Manager whether an ARM/Bicep template is syntactically correct and would be accepted for deployment into an existing resource group, 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.
Validation answers a different question from New-AzResourceGroupDeploymentWhatIf: this cmdlet reports whether the template would be accepted, while what-if predicts the individual resource changes a valid template would produce. When the template is valid the validation result is returned; when it is not, the cmdlet writes the validation errors and terminates with a non-zero exit code.
Examples
Validate a Bicep template before deploying it
Validate 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 template. Use Incremental (default) to add and update resources, or Complete to also account for resources in the resource group that aren't declared in the template.
The name of the deployment. Used to track and reference the validation in deployment history. When omitted, defaults to the template file or URI name without its extension, or a generated GUID when no valid name can be derived.
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.
Record that the resource group should roll back to its last successful deployment if the deployment later fails. Mutually exclusive with -RollbackToDeploymentName.
Resource ID of an existing template spec to validate (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 DeploymentValidateResult describing the outcome of the validation, including the validated resources and the deployment properties Azure Resource Manager resolved. No resources are created or modified.
Notes
Validation is read-only: it never creates or modifies resources. A template that fails validation is reported as an error listing the validation failures, so a non-zero exit code means "the template would be rejected", not "the command malfunctioned". Use New-AzResourceGroupDeployment to deploy once validation passes.
Differences from Az.Resources: on success this cmdlet returns the DeploymentValidateResult instead of no output, and validation failures are written to the error stream (capture them with -ErrorVariable) instead of to the output stream as a list of PSResourceManagerError objects. The legacy parameter names -TemplateParameterFile, -TemplateParameterUri, -RollbackToLastDeployment, and -RollBackDeploymentName are accepted as aliases.
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.