New-​Azure​Rm​Resource​Group​Deployment

Adds an Azure deployment to a resource group.

Syntax

New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateFile <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateFile <String>
   -TemplateParameterObject <Hashtable>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateFile <String>
   -TemplateParameterFile <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateFile <String>
   -TemplateParameterUri <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateParameterFile <String>
   -TemplateUri <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateParameterObject <Hashtable>
   -TemplateUri <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateParameterUri <String>
   -TemplateUri <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmResourceGroupDeployment
   [-ApiVersion <String>]
   [-DeploymentDebugLogLevel <String>]
   [-Force]
   [-Mode <DeploymentMode>]
   [-Name <String>]
   [-Pre]
   -ResourceGroupName <String>
   -TemplateUri <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-AzureRmResourceGroupDeployment cmdlet adds a deployment to an existing resource group. This includes the resources that the deployment requires.

An Azure resource is a user-managed Azure entity, such as a database server, database, website, virtual machine, or Storage account. An Azure resource group is a collection of Azure resources that are deployed as a unit, such as the website, database server, and databases that are required for a financial website. A resource group deployment uses a template to add resources to a resource group and publishes them so that they are available in Azure. To add resources to a resource group without using a template, use the New-AzureRmResource cmdlet.

To add a resource group deployment, specify the name of an existing resource group and a resource group template. A resource group template is a JSON string that represents a resource group for a complex cloud-based service, such as a web portal. The template includes parameter placeholders for required resources and configurable property values, such as names and sizes. You can find many templates in the Azure template gallery or you can create your own templates. You can use the Get-AzureRmResourceGroupGalleryTemplate cmdlet to find a template in the gallery.

To use a custom template to create a resource group, specify the TemplateFile parameter or TemplateUri parameter. Each template has parameters for configurable properties. To specify values for the template parameters, specify the TemplateParameterFile parameter or the TemplateParameterObject parameter. Alternatively, you can use the template parameters that are dynamically added to the command when you specify a template. To use dynamic parameters, type them at the command prompt, or type a minus sign (-) to indicate a parameter and use the Tab key to cycle through available parameters. Template parameter values that you enter at the command prompt take precedence over values in a template parameter object or file.

Examples

Example 1: Use a custom template and parameter file to create a deployment

PS C:\>New-AzureRmResourceGroupDeployment -ResourceGroupName "ContosoEngineering" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json" -TemplateVersion "2.1"

This command creates a new deployment by using a custom template and a template file on disk. The command uses the TemplateFile parameter to specify the template and the TemplateParameterFile parameter to specify a file that contains parameters and parameter values. It uses the TemplateVersion parameter to specify the version of the template.

Required Parameters

-ResourceGroupName

Specifies the name of the resource group to deploy.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TemplateFile

Specifies the full path of a JSON template file. This can be a custom template or a gallery template that is saved as a JSON file, such as one created by using the Save-AzureRmResourceGroupGalleryTemplate cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TemplateParameterFile

Specifies the full path of a JSON file that contains the names and values of the template parameters. If a template has parameters, you must specify the parameter values with the TemplateParameterFile parameter or the TemplateParameterObject parameter. Template parameters are dynamically added to the command when you specify a template.

To use the dynamic parameters, type a minus sign (-) to indicate a parameter name and then use the Tab key to cycle through the available parameters.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TemplateParameterObject

Specifies a hash table of template parameter names and values. For help with hash tables in Windows PowerShell, type Get-Help about_Hash_Tables. If a template has parameters, you must specify parameter values. Template parameters are dynamically added to the command when you specify a template.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TemplateParameterUri

Specifies the URI of a template parameters file.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TemplateUri

Specifies the URI of a JSON template file. This file can be a custom template or a gallery template that is saved as a JSON file, such as by using Save-AzureRmResourceGroupGalleryTemplate.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApiVersion

Specifies the API version that is supported by the resource Provider. You can specify a different version than the default version.

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

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DeploymentDebugLogLevel

Specifies a debug log level. The acceptable values for this parameter are:

  • RequestContent
  • ResponseContent
  • All
  • None
Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

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

Specifies the deployment mode. The acceptable values for this parameter are:

  • Complete
  • Incremental
Type:DeploymentMode
Position:Named
Default value:Incremental
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the resource group deployment to create.

Type:String
Aliases:DeploymentName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.ResourceManager.Models.PSResourceGroupDeployment