Moving Windows VM to another Azure subscription or resource group

  1. Home
  2. Moving Windows VM to another Azure subscription or resource group

Return to AZ-104 Tutorial Page

Here you will learn Azure subscription and how to move a Windows VM between resource groups. You’ll also have a thorough understanding of subscriptions, which will come in handy if you originally built a virtual machine in a personal subscription. After that, the subscription is transferred to your company’s subscription so that the job can continue. The VM does not need to be stopped in order to be moved, and it should remain operational during the process.

Using the Azure portal to move a VM to a different subscription

Understand you can move a VM and its associated resources to a various subscription by using the Azure portal. So, follow these steps:

  1. First of all, visit the Azure portal to maintain the resource group containing the VM to move. Now, search for and click Resource groups.
  2. After this, choose the resource group containing the VM that you wish to move.
  3. Now, select Move and then select Move to another subscription. The Move resources page automatically opens.
  4. After this, select all the resources to move. 
  5. After this, select the Subscription where you want the VM to be moved.
  6. Now, select an existing Resource Group, and enter a name to have a new resource group created.
  7. Lastly, select that you understand that new resource IDs will be created and that the new IDs will need to be used with the VM after it is moved, and then select OK.

Using the Azure portal to move a VM to another resource group

Using the Azure interface, relocate a VM and its associated resources to a different resource group.

  1. Firstly, go to the Azure portal to manage the resource group containing the VM to move. Search for and select Resource groups.
  2. Now, choose the resource group containing the VM that you would like to move.
  3. After this, select Move and then select Move to another resource group. The Move resources page opens.
  4. Furthermore, select each of the resources to move. 
  5. Next, select an existing Resource Group, and enter a name to have a new resource group created.
  6. After completion, select that you understand that new resource IDs will be created and that the new IDs will need to be used with the VM after it is moved, and then select OK.
Azure subscription 1

Using Powershell to move a VM

When moving a virtual machine to a different resource group, make sure you move the dependant resources as well. Use the Get-AzResource cmdlet to get a list of all of these resources’ resource IDs.

Get-AzResource -ResourceGroupName myResourceGroup | Format-table -wrap -Property ResourceId

You can also use the output of the previous command to create a comma-separated list of resource IDs that you can pass to Move-AzResource to move each resource to the desired location.

Move-AzResource -DestinationResourceGroupName "myDestinationResourceGroup" `
-ResourceId

To move the resources to different subscription, include the -DestinationSubscriptionId parameter.

Azure subscription

Reference: Microsoft Documentation

Return to AZ-104 Tutorial Page

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.

Menu