There may be a need after you have virtual machines in Microsoft Azure that you need to relocate these to a different resource group, subscription, or region. These are fairly common tasks that can arise from time to time. Let’s look at how to move a VM to another resource group, subscription, or region in Azure.
Understanding the locations
Before we get into the specifics of moving a virtual machine to a different location, let’s talk about the locations themselves that can be the target of a move. Note the following locations in the context of moving VMs, where these can be relocated:
- Resource Group: The resource group is a logical container that holds the Azure resources that are generally related to one another in Microsoft Azure. These resources can be deployed one-by-one as individual items or as a single unit in a resource group.
- Subscription: Your Azure subscription is the agreement you have with Microsoft to use one or more Microsoft services in the cloud. A subscription is where the limits or quotas are set on the amount of resources you create and can use.
- Region: An Azure region is a group of Azure data centers that are located within a low latency-defined area. These are connected using a high speed, low-latency connection that exists in the same geographical region
Things to think about beforehand
There are a few things you need to think about beforehand when moving resources. What are these? You will want to make sure of the following things before moving:
- If moving between different subscriptions, the source and destination resources must be active and enabled
- The subscriptions must be located in the same Microsoft Entra ID tenant
- There are special steps and processes related to moving resources to or from a Cloud Solution Provider (CSP)
- The actual resources themselves must support the move operation
- There are some services that have limitations when being moved so be sure to check the guidance for those specific resources when moving them
- The destination subscription must be registered for the resource provider for the resource being moved
- Check subscription quotas
- The account that is moving the resources needs to have permission to do so
- Azure roles are not moved with the resource being moved, these will be orphaned
- Moving across subscriptions requires the resource and any dependent resources to be located in the same resource group and must be moved at the same time
Steps to move a VM to another resource group
Let’s look at the steps briefly to move a virtual machine to another resource group. First, log in to the Azure Portal:
Navigate to Resource groups by searching for it in the search box.
Once you are at the Resource groups blade, select the resource you want to move and select the Move menu and select from one of the options:
- Move to another resource group
- Move to another subscription
- Move to another region
It will launch the Move resource wizard. Select the target resource group for the move.
It will then validate whether or not the resource can be moved.
The validation process is successful.
Review the move operation and check the box next to the “I understand that tools and scripts associated with moved resources will not work until I update them to use new resource IDs.”
When you click Move, it will begin the process of moving the object to the new resource group.
After a short period of time, the resource move completes successfully. This operation typically doesn’t take long and completes within a few minutes. Also, important to note, if moved within the same region, it doesn’t cause any downtime for the VM.
Considerations and Best Practices
Note the following considerations and best practices that are important to note before performing a move operation.
- Downtime: Moving a VM to another resource group in the same region does not cause downtime. However, do understand that moving a VM to another region typically involves downtime. So, you will likely want to plan the move during a maintenance window.
- Compatibility: Make sure that the VM’s configuration is compatible with the target region, also the resource group, or the subscription.
- Quotas and Limits: You will want to make sure the destination resource group or subscription has enough resources left in any quotas to house the VM.
- Cost: There are costs associated with replication and data transfer between regions. Keep this in mind when moving VMs to a different region.
Wrapping up
Due to various reasons, resources may need to be moved from one resource group to another resource group in the same subscription, or to a different subscription, or even to a different region. It is great that Microsoft has included this functionality natively in Azure to be able to perform these types of move operations.
Do be sure to understand the ins and outs of moving resources between a resource group or subscription for the AZ-104 exam. By following the steps shown above, you can make sure you have a smooth and efficient migration process to a different resource group, subscription, or region.
Read more on AZ-104:
Microsoft Azure Administrator – AZ-104: Configuring Azure Disk Encryption on Azure VMs – Part 42
Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.