Q. How can I move resources between Azure Resource Groups?
Move resources between resource groups using PowerShell
July 27, 2015
Q. How can I move resources between Azure Resource Groups?
A. To move resources between Azure Resource Groups use the various AzureResource PowerShell cmdlets. After loading the Azure PowerShell module and authenticating using an Azure AD account (Add-AzureAccount) switch the mode to Azure Service Manager.
Switch-AzureMode -Name AzureResourceManager
Firstly to view all Resource Groups use:
Get-AzureResourceGroup
To view all resources in a specific Resource Group use:
Get-AzureResource -ResourceGroupName
To move all resources in a Resource Group use (I use Force to avoid prompt to confirm the move)
Get-AzureResource -ResourceGroupName | Move-AzureResource -DestinationResourceGroupName -Force
To move an individual resource use:
Get-AzureResource -ResourceName -ResourceGroupName | Move-AzureResource -DestinationResourceGroupName -Force
Easy!
About the Author
You May Also Like