You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<maml:para>Specifies the name of the deployment project for the resource group. Because the deployment properties are defined in a template, this parameter is valid only when you specify a template. This parameter is optional. The default value is the template name without the .json file name extension.</maml:para>
<maml:para>Specifies a particular version of the gallery or custom template. Enter the version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, New-AzureRmResourceGroup verifies that the specified template has the matching version and fails if it does not.</maml:para>
<maml:para>Specifies a hash table of template parameter names and values. For help with hash tables in Windows PowerShell, type: Get-Help about_Hash_Tables.This parameter is optional. If a template has parameters, you must specify parameter values, but you can use the TemplateParameterObject or the TemplateParameterFile parameters. Or, you can use the template parameters are added to the command dynamically when you specify a template. To use the dynamic parameters, just type them in the command, or type a minus sign to indicate a parameter name (-) and then press the TAB key repeatedly to cycle through the available parameters. If you miss a required parameter, the cmdlet prompts you for the value.</maml:para>
<maml:para>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 the Save-AzureRmResourceGroupGalleryTemplate cmdlet.</maml:para>
<maml:para>Specifies the path and file name of a JSON template file on disk. This can be a custom template or a gallery template that is saved to disk as a JSON file, such as by using the Save-AzureRmResourceGroupGalleryTemplate cmdlet.To use this parameter, the subscription must include a storage account where the cmdlet can save the template. By default, this cmdlet uses the current storage account in the subscription, but you can use the StorageAccountName parameter to specify an alternate storage account. If you do not specify a storage account and the subscription does not have a storage account that is designated as "current," the command fails.To create a storage account, use the Switch-AzureMode cmdlet to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.</maml:para>
<maml:para>Specifies the name of a storage account in the subscription. New-AzureRmResourceGroup saves the contents of template files in the storage account. This parameter is optional, but a storage account is required when you use the TemplateFile parameter.The default value is the current storage account in the subscription. If you do not specify a storage account and the subscription does not have a current storage account, the command fails.To create a storage account, use a Switch-AzureMode -Name AzureServiceManagement command to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.</maml:para>
<maml:para>Specifies the identity of a template in the Azure gallery. To find gallery templates, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet. The value of the Identity property of each gallery item is displayed by default.</maml:para>
<maml:para>Specifies the path and name of a JSON file with the names and values of the template parameters. This parameter is optional. If a template has parameters, you must specify parameter values, but you can use the TemplateParameterObject or the TemplateParameterFile parameters. Or, you can use the template parameters are added to the command dynamically when you specify a template. To use the dynamic parameters, just type them in the command, or type a minus sign to indicate a parameter name (-) and then press the TAB key repeatedly to cycle through the available parameters. If you miss a required parameter, the cmdlet prompts you for the value.</maml:para>
<maml:para>This command creates the "ContosoHosting" resource group from a custom template. It uses the TemplateFile parameter to specify the path and file name of the ContosoHosting.json template file and the TemplateParameterFile parameter to specify the ContosoHostingParms.json file, which contains the names and values of the parameters in the template. Because the command does not specify a storage account, New-AzureRmResourceGroup uses the current storage account in the subscription.</maml:para>
4645
-
<maml:para />
4646
-
<maml:para />
4647
-
<maml:para>
4648
-
</maml:para>
4649
-
</dev:remarks>
4650
-
<command:commandLines>
4651
-
<command:commandLine>
4652
-
<command:commandText>
4653
-
<maml:para />
4654
-
</command:commandText>
4655
-
</command:commandLine>
4656
-
</command:commandLines>
4657
-
</command:example>
4658
-
<command:example>
4659
-
<maml:title>-------------------------- Example 3: Create a resource group from a gallery template --------------------------</maml:title>
<maml:para>This example shows how to create a resource group from a gallery template and use the parameters that are added to the command dynamically to provide the template parameter values.</maml:para>
4674
-
<maml:para />
4675
-
<maml:para />
4676
-
<maml:para>This command uses the New-AzureRmResourceGroup cmdlet to create a new resource group. It uses the GalleryTemplateIdentity parameter to specify the identity of the gallery template. In this scenario, you don't need to save the gallery template to disk.After you type the cmdlet parameters and values, type a minus sign (to indicate a parameter name) and then press the TAB key to trigger tab-completion. The cmdlet adds a parameter, such as siteMode. Type the parameter value, type a minus sign, press TAB, and it adds another parameter. To cycle through the parameter names, press TAB repeatedly. If you miss a mandatory template parameter, the cmdlet prompts you for the value.</maml:para>
4677
-
</dev:remarks>
4678
-
<command:commandLines>
4679
-
<command:commandLine>
4680
-
<command:commandText>
4681
-
<maml:para />
4682
-
</command:commandText>
4683
-
</command:commandLine>
4684
-
</command:commandLines>
4685
-
</command:example>
4686
-
<command:example>
4687
-
<maml:title>-------------------------- Example 4: Create a resource group from a saved gallery template --------------------------</maml:title>
4688
-
<maml:introduction>
4689
-
<maml:paragraph>PS C:\></maml:paragraph>
4690
-
</maml:introduction>
4691
-
<dev:code>PS C:\> The first command uses the Get-AzureRmResourceGroupGalleryTemplate to get a gallery item. It pipes the gallery item to the Save-AzureRmResourceGroupGalleryTemplate cmdlet, which save the template as a JSON file in the path that you specify.
Before we create the hash table of template parameters, we need to know which parameters the template requires. The second command uses the Get-Content cmdlet to get the contents of the template file and its Raw parameter, which ignores line breaks and returns a single JSON string. The command pipes the template to the ConvertFrom-Json cmdlet, which returns a custom object (PSCustomObject) that represents the template and saves it in the $t variable. You can use this technique to manipulate the template in Windows PowerShell.
The third command gets the Parameters property of the template custom object. The object also has a Resources property that represents the resources in the template.
4702
-
PS C:\>$t.Parameters
4703
-
siteName : @{type=string}
4704
-
hostingPlanName : @{type=string}
4705
-
siteMode : @{type=string}
4706
-
computeMode : @{type=string}
4707
-
siteLocation : @{type=string}
4708
-
subscriptionId : @{type=string}
4709
-
resourceGroup : @{type=string}
4710
-
4711
-
The fourth command creates a hash table of the template parameters and values and saves them in a $params variable.
The fifth command uses the New-AzureRmResourceGroup cmdlet to create the resource group. It uses the TemplateFile parameter to specify the gallery template file on disk and the TemplateParameterObject parameter to specify the hash table of template parameter names and values in the $params variable. It uses the StorageAccountName parameter to specify the storage account in which the template is stored. You must specify a storage account when you use the TemplateFile parameter and a "current" storage account has not been selected for the subscription.The cmdlet returns an object that represents the new resource group.
<maml:para>This example shows how to create a resource group from a gallery template that you saved to disk by using the Save-AzureRmResourceGroupGalleryTemplate cmdlet and a hash table of template parameter names and values.</maml:para>
4727
-
<maml:para />
4728
-
<maml:para />
4729
-
<maml:para>
4730
-
</maml:para>
4731
-
</dev:remarks>
4732
-
<command:commandLines>
4733
-
<command:commandLine>
4734
-
<command:commandText>
4735
-
<maml:para />
4736
-
</command:commandText>
4737
-
</command:commandLine>
4738
-
</command:commandLines>
4739
-
</command:example>
4740
-
<command:example>
4741
-
<maml:title>-------------------------- Example 5: Create a resource group with tags --------------------------</maml:title>
4535
+
<maml:title>-------------------------- Example 2: Create a resource group with tags --------------------------</maml:title>
0 commit comments