New-AzResourceGroup
Create a new resource group.
Syntax
Default (Default)
New-AzResourceGroup
-Name <string>
-Location <string>
[-SubscriptionId <string>]
[-Profile <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Provision a new resource group in your Azure subscription. Specify the resource group name and location (region). The subscription ID is optional and defaults to the current subscription when omitted. The resource group will be created immediately and can be used to organize your Azure resources.
Examples
Create a resource group in the current subscription
Provision a new resource group named myrg in the East US region using the current subscription.
New-AzResourceGroup -Name myrg -Location eastus
Create a resource group in a specific subscription
Provision a new resource group named myrg in the East US region under a specific subscription.
New-AzResourceGroup -Name myrg -Location eastus -SubscriptionId 00000000-0000-0000-0000-000000000000
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Location
Location for resource group.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Name
The name of the resource group.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Profile
Name of a saved profile to use for this call instead of the currently-active one. Manage profiles with Set-AzProfile / Get-AzProfile.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SubscriptionId
Azure Subscription Id. Defaults to the active profile's subscription.
Parameter properties
| Type: | String |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Parameter properties
| Type: | SwitchParameter |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
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.
Outputs
Microsoft.Azure.Azclips.Extensions.Resources.Models.ResourceGroup
The newly-created ResourceGroup object, including its ARM resource ID and provisioning state.