Test-AzResourceGroupDeployment
This cmdlet performs a validation of a resource group deployment. It checks the syntax and structure of your ARM template without actually deploying resources. This is a crucial step for catching errors early in the development lifecycle.
SYNTAX
Test-AzResourceGroupDeployment -Name <String> -ResourceGroupName <String> [-TemplateFile <String>] [-TemplateUri <String>] [-TemplateParameterFile <String>] [-TemplateParameterObject <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]DESCRIPTION
                The Test-AzResourceGroupDeployment cmdlet validates an Azure Resource Manager (ARM) template and its parameters. This cmdlet does not deploy any resources; it only performs a validation check against the specified Azure subscription and resource group.
            
This is useful for ensuring that your ARM templates are syntactically correct and would deploy successfully if executed. You can test deployments from template files or URIs, and provide parameters from parameter files or objects.
PARAMETERS
| Name | Type | Description | 
|---|---|---|
| -Name | String | Specifies the name of the deployment to test. This name is used for logging and reporting purposes. | 
| -ResourceGroupName | String | Specifies the name of the resource group where the deployment would be tested. This resource group must exist in your Azure subscription. | 
| -TemplateFile | String | Specifies the local path to the ARM template file to validate. | 
| -TemplateUri | String | Specifies the URI of the ARM template to validate. This can be a publicly accessible URL or a Blob storage URI. | 
| -TemplateParameterFile | String | Specifies the local path to the JSON file containing the deployment parameters. | 
| -TemplateParameterObject | Object | Specifies a PowerShell hashtable containing the deployment parameters. | 
| -WhatIf | Switch | Shows what would happen if the cmdlet runs. The cmdlet is not run. | 
| -Confirm | Switch | Prompts you for confirmation before running the cmdlet. | 
RELATED LINKS
EXAMPLE 1: Test a deployment using a local template file and parameter file
Test-AzResourceGroupDeployment -Name "MyTemplateTest" -ResourceGroupName "MyResourceGroup" -TemplateFile "C:\ARM\MyTemplate.json" -TemplateParameterFile "C:\ARM\MyParameters.json"
                    This command tests a deployment named "MyTemplateTest" against the resource group "MyResourceGroup" using a local template file MyTemplate.json and a local parameter file MyParameters.json.
                
EXAMPLE 2: Test a deployment using a template URI and parameter object
$parameters = @{
    storageAccountType = "Standard_LRS"
    location = "West US"
}
Test-AzResourceGroupDeployment -Name "WebDeploymentTest" -ResourceGroupName "WebAppRG" -TemplateUri "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json" -TemplateParameterObject $parametersThis command tests a deployment named "WebDeploymentTest" against the resource group "WebAppRG" using a template from a GitHub URI and defines parameters directly within the command using a PowerShell hashtable.