How To Move VM From One Resource Group To Another In Azure

Recently, I got the requirement to move my Azure VM from one resource group to another. In this article, I will walk you through all the steps to move VM from one Resource Group to another in Azure.

How To Move VM From One Resource Group To Another In Azure

Let us discuss all the approaches individually.

Approach-1: Using Azure Portal

To move VM from one Resource Group to another in Azure, follow the below steps.

1. Log in to Azure Portal.

2. Search for Virtual Machines and click on the search result in Virtual Machines under the services as shown in the below screenshot.

Move VM From One Resource Group To Another In Azure

3. Now, click on the specific Virtual Machine from the list.

move azure vm to another resource group

4. Click the move link next to the Resource Group name on the Overview page, as shown in the screenshot below.

how to move vm from one resource group to another azure

5. On the Target section, Select the new Resource Group from the drop-down, or you can click the Create new link to create a new Resource Group and then click the Next button as shown in the screenshot below.

How To Move VM From One Resource Group To Another In Azure

6. On the Resources to Move screen, it will validate whether the VM is eligible for movement or not, if it is valid, it will show the validation status as succeeded, and then click on the Next button.

How do I move a VM from one resource group to another in Azure?

7. On the Review tab, select the terms and condition and then click the Move button.

how to move vm from azure resource group to another in azure

Now, the Resource Group has been moved successfully to the new Resource Group, as shown in the screenshot shown below.

move vm from azure resource group to another in azure

Approach-2: Using Azure PowerShell

We can use the Move-AzResource PowerShell command to move a new Resource Group, as mentioned below.

Move-AzResource -DestinationResourceGroupName "newresgroup" -ResourceId "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/MyNewResGrp/providers/Microsoft.Compute/virtualMachines/AzurelessonsNewVM"

After executing the above command, click the Yes button for the confirmation. Now, I got the expected output as shown in the screenshot shown below.

How To Move VM From One Resource Group To Another In Azure PowerShell
Move VM From One Resource Group To Another In Azure PowerShell
How To Move VM From One Resource Group To Another In Azure using PowerShell

Approach-3: Using Azure CLI

az resource move --destination-group "MyNewResGrp" --ids "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/MyNewResGrp/providers/Microsoft.Compute/virtualMachines/AzurelessonsNewVM"

After executing the above command, I got the expected output, as shown below, and the Azure VM has been moved successfully to the new destination Resource Group.

How To Move VM From One Resource Group To Another In Azure Azure CLI
How To Move VM From One Resource Group To Another In Azure using Azure CLI

Video Tutorial

You may also like following the articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!