Test-AzureRmDeployment

Validates a deployment.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Test-AzureRmDeployment
    -Location <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterObject <Hashtable>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterObject <Hashtable>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterFile <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterFile <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterUri <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterUri <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Test-AzureRmDeployment cmdlet determines whether a deployment template and its parameter values are valid.

Examples

Example 1: Test deployment with a custom template and parameter file

PS C:\>Test-AzureRmDeployment -Location "West US" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json"

This command tests a deployment at the current subscription scope using the given template file and parameters file.

Parameters

-ApiVersion

When set, indicates the version of the resource provider API to use. If not specified, the API version is automatically determined as the latest available.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

The location to store deployment data.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Pre

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TemplateFile

Local path to the template file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateParameterFile

A file that has the template parameters.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateParameterObject

A hash table which represents the parameters.

Type:Hashtable
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateParameterUri

Uri to the template parameter file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateUri

Uri to the template file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Microsoft.Azure.Management.ResourceManager.Models.DeploymentMode System.Collections.Hashtable

Outputs

PSResourceManagerError