For system, network and cloud administrators

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

Verify if the new resource group has the same location as you needed:

Get-AzResourceGroup -Name $rgname

Leave a Reply

Your email address will not be published. Required fields are marked *