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.

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

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

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.

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.

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

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

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.

