For system, network and cloud administrators

How to create an Azure resource group using Azure PowerShell

In order to create a new Azure resource group, remember you’ll also have to mention a location.

New-AzResourceGroup -Name yourresourcegroupname -Location westeurope


How to create an Azure resource group in the same region as previous resource group using Azure PowerShell

Sometimes it helps to create a resource group in Azure that has the same location as a specific desired resource group. Open an Azure PowerShell session and type:

$location = (Get-AzResourceGroup -Name theresourcegroupiwanttocopyfrom).Location
$rgname = 'thenewresourcegroup'
New-AzResourceGroup -Name $rgname -Location $location