New-AzResourceGroup

Creates a resource group to contain other Azure resources.

SYNOPSIS

Creates a resource group.

SYNTAX

New-AzResourceGroup -Name <String> [-Location <String>] [-Force] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] []

DESCRIPTION

The New-AzResourceGroup cmdlet creates a resource group in your Azure subscription. A resource group is a logical container that holds related resources for an Azure solution.

You can specify the name and location for the resource group. You can also use the -Tag parameter to assign tags to the resource group.

PARAMETERS

EXAMPLE USAGE

Create a resource group with a name and location

New-AzResourceGroup -Name "MyResourceGroup" -Location "East US"

Create a resource group with a name, location, and tags

New-AzResourceGroup -Name "MyWebAppRG" -Location "West Europe" -Tag @{"Environment"="Production"; "Application"="ContosoWeb"}

Create a resource group, overwriting if it already exists

New-AzResourceGroup -Name "MyResourceGroup" -Location "East US" -Force

INPUTS

None. You can pipe to this cmdlet.

OUTPUTS

Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.PSResourceGroup

NOTES

Resource groups are a fundamental concept in Azure for managing resources. They allow you to group related resources and manage them as a single unit for tasks like deployment, monitoring, and access control.

RELATED LINKS

Get-AzResourceGroup

Remove-AzResourceGroup

Set-AzResourceGroup