---
title: "How to Move a Hyper-V VM to Azure with Azure Migrate [Guide]"
description: "Learn, step-by-step how to move an on-prem Hyper-V VM to Azure with the Azure Migrate tool in this handy guide!"
canonical: "https://adamtheautomator.com/azure-migrate/"
---

# How to Move a Hyper-V VM to Azure with Azure Migrate [Guide]

> Learn, step-by-step how to move an on-prem Hyper-V VM to Azure with the Azure Migrate tool in this handy guide!

Source: https://adamtheautomator.com/azure-migrate/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Move a Hyper-V VM to Azure with Azure Migrate \[Guide\]](https://adamtheautomator.com/wp-content/uploads/2021/05/How-to-Move-a-Hyper-V-VM-to-Azure-with-Azure-Migrate-Guide.jpg)

# How to Move a Hyper-V VM to Azure with Azure Migrate \[Guide\]

[![](https://secure.gravatar.com/avatar/75fa5f572fb085a46bfff406309882e0848db4770557901e8de897b3f7d05a7a?s=192&d=mm&r=g)Nick Rimmer](https://adamtheautomator.com/author/nick/)26 May 20219 min. read

Categories: [Cloud](/category/cloud/)

Tags:[Azure Migrate](/tag/azure-migrate/)[Azure Virtual Machines](/tag/azure-virtual-machines/)[hyper-v](/tag/hyper-v/)[Microsoft Azure](/tag/microsoft-azure/)

Table of Contents

*   [Prerequisites](#h-prerequisites)
*   [Setting Up the Azure Recovery Service Agent](#h-setting-up-the-azure-recovery-service-agent)
*   [Replicating Virtual Machines into Azure](#h-replicating-virtual-machines-into-azure)
*   [Performing a Test Migration](#h-performing-a-test-migration)
*   [Performing a Live Migration](#h-performing-a-live-migration)
*   [Cleaning Up](#h-cleaning-up)
*   [Conclusion](#h-conclusion)

So you’ve drunk the Azure Koolaid and want to migrate your Hyper-V VMs to Azure. That’s great news! Do you know what even better news is? Azure provides a service called [Azure Migrate](https://docs.microsoft.com/en-us/azure/migrate/migrate-services-overview) that makes the process as easy as possible.

In this step-by-step tutorial, you’re going to learn how to migrate a Hyper-V VM with Azure Migrate by replicating the VM to Azure with [Azure Site Recovery](https://docs.microsoft.com/en-us/azure/site-recovery/site-recovery-overview) (ASR).

> _If you haven’t created an Azure assessment via the Azure Migrate tool yet, please head over to the [How to Prep a Hyper-V VM with the Azure Migration Assessment Tool](https://adamtheautomator.com/azure-migration-assessment-tool/) post to learn how to discover and assess your Hyper-V VMs first._

## Prerequisites

If you plan to follow along, ensure you have the following in place before following this step by step tutorial:

*   An [Azure assessment](https://adamtheautomator.com/azure-migration-assessment-tool/) to the _How to Prep a Hyper-V VM with the Azure Migration Assessment Tool post_ for the Hyper-V VM(s) you intend to migrate.
*   A Windows [Hyper-V](https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-on-windows-server) host – This tutorial uses a physical Windows 2016 server with the Hyper-V role installed equipped with 8GB of RAM and a dual-core i7 (2ghz) processor. To migrate VMs to Azure, your Hyper-V host must be installed on Windows Server 2019, Windows Server 2016, or Windows Server 2012 R2 with the latest updates.
*   .NET Framework 4.7 or later installed on the Hyper-V host
*   A Hyper-V VM – This tutorial uses a Windows 2012 R2 Server VM with 1GB of RAM a single vCPU. Any Hyper-V VM should work, though.
*   An [Azure Subscription](https://adamtheautomator.com/azure-free/) – If you don’t have one, you can [register for a free Azure account](https://azure.microsoft.com/en-us/free/).
*   An Azure user account with at least [Contributor Role](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) permissions to the Azure subscription and [Application Administrator](https://docs.microsoft.com/en-us/azure/active-directory/roles/permissions-reference#application-administrator) permissions to register AzureAD apps.
*   A [storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal) for your migration – This tutorial will use a storage account named _migndr2021_.
*   A [virtual network](https://docs.microsoft.com/en-us/azure/virtual-network/quick-create-portal) for your migrated virtual machine – This tutorial will use a virtual network named _mig\_network_ and a subnet named _default_.

Related:[How to Import and Export Hyper-V VMs with PowerShell](https://adamtheautomator.com/export-hyper-v-vm/)

## Setting Up the Azure Recovery Service Agent

Once you’ve run an [Azure assessment](https://adamtheautomator.com/azure-migration-assessment-tool/) , it’s time to install the Azure Site Recovery (ASR) Service agent on your Hyper-V host. ASR is a disaster-recovery service that manages and orchestrates server replication, failover, and Azure virtual machines’ failback. It just so happens that the Azure Migrate service uses ASR to replicate Hyper-V VM to Azure also.

To setup the ASR agent on your Hyper-V host:

1\. Open your favorite browser and navigate to the [Azure Migrate](https://portal.azure.com/#blade/Microsoft_Azure_Migrate/AmhResourceMenuBlade/getStarted) hub.

2\. Navigate to the **Migration tools** tile and click **Discover**. This action starts the migration process.

![Navigate the Migration Tool](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T101707.674.png)

Navigate the Migration Tool

3\. On the **Discover** page, click on the **Are your machines virtualized?** drop-down box and select **Yes, with Hyper-V.**

Specify the Azure region you intend to migrate the VMs as the **Target region**.

Tick the checkbox to **Confirm that the target region for migration is <region>** and click on **Create resources**. These steps begin the migration discovery process to confirm that you are using VMs and which virtualization technology you’re using.

> _When you start the discovery progress during a migration, Azure creates an [Azure Site Recovery Vault](https://docs.microsoft.com/en-us/azure/backup/backup-azure-recovery-services-vault-overview) in the background and also creates an [Azure key vault](https://docs.microsoft.com/en-us/azure/key-vault/general/basic-concepts) to store credentials used during the migration process. Azure Migrate creates the ASR Vault in the same resource group as your Azure Migrate project. The vault is used to store information on VM and workload configuration._

![Set target region for resources ](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102107.047.png)

Set target region for resources

> _WARNING: You cannot change the target region after this step. If you need to use another region for other servers, you must create another Azure Migrate project._

4\. Once you’ve created the Migrate resources, click on the first **Download** link to download the replication provider/agent.

![Click on the first download for the site recovery software](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102219.386.png)

Click on the first download for the site recovery software

5\. Copy the downloaded provider/agent (_AzureSiteRecoveryProvider.exe)_ to your Hyper-V host.

6\. Now, click the **Download** button to generate a software registration key. This key is used to register the Azure Site Recovery software that you install in step 8.

> _Keep your software registration key safe because you’ll need it when you install the replication provider on your Hyper-V host._

![Click to download registration key](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102316.776.png)

Click to download registration key

7\. Connect to your Hyper-V host(s) console and run the _AzureSiteRecoveryProvider.exe_ installer.

8\. Click **Next** to accept all defaults until you reach the screen with the **Register** button on it, as shown below.

If you’d like to change the install location, click on **Browse** and change the path. This tutorial will use the default path.

Click on **Register** to tell the ASR agent to register the on-premises Hyper-V host with Microsoft Azure. Next, you’ll be presented with a **Vault Settings** screen to continue configuration.

![Azure Site recovery Install process](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102447.121.png)

Azure Site recovery Install process

9\. On the **Vault Settings** screen, click on **Browse,** select the registration key you downloaded in step six and click **Next**.

![Site recovery Install - Browse for registration key](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102536.215.png)

Site recovery Install – Browse for registration key

10\. Now, switch back to your web browser where you have the Azure Migrate hub open, refresh the page and click on **Finalize Registration**. You should now see **1 (Connected)** next to **Registered Hyper-V hosts** indicating your Hyper-V host is now connected and ready to replicate VMs.

![Click on finalize Registration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T102619.673.png)

Click on finalize Registration

## Replicating Virtual Machines into Azure

Once Azure Migrate has discovered all Hyper-V VMs, and you’ve set up the ASR agent on your Hyper-V host, it’s time to begin replicating Hyper-V VMs to Azure!

1\. In the Azure Migrate hub, in the **Migration tools** tile, click on **Replicate**. This action will bring you to the **Replicate** page.

![Click on replicate to begin](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T104302.410.png)

Click on replicate to begin

2\. On the **Replicate** page, under the **Source settings** section, select **Yes, with Hyper-V** and click **Next**. This action will bring you to the **Virtual Machines** section.

![Click on Next](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T104636.546.png)

Click on Next

3\. In the **Virtual Machines** section, select **Yes, apply migration settings from an Azur Migrate Assessment** from the **Import migration settings from an Assessment dropdown box.**

> _If you haven’t created an Azure assessment via the Azure Migrate tool yet, head over to the [How to Prep a Hyper-V VM with the Azure Migration Assessment Tool](https://adamtheautomator.com/azure-migration-assessment-tool/) post to learn how to discover and assess your Hyper-V VMs first._

*   Select **DEV\_GROUP** from the **Select group** dropdown box to select all VMs previously defined in that group if you followed along with the [Azure assessment](https://adamtheautomator.com/azure-migration-assessment-tool/) post.
*   Select **DEV\_SERVER** from the **Select assessment** box.
*   Tick the checkbox next to any VMs you’d like to migrate.
*   Click **Next** to continue. This action will bring you to the **Target settings** section. The Target settings define the resource group, storage account, network, and availability options Azure Migrate will apply to your virtual machines.

![Replication wizard](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T104758.384.png)

Replication wizard

4\. In the **Target settings** page, define each setting as shown below.

*   **Region** – The Azure region to replicate the VM(s) too. The region is greyed out as it can’t be changed during the migration process.
*   **Subscription** – The Azure subscription to replicate the VMs to.
*   **Resource group** – The resource group to create the new Azure VM resources in.
*   **Virtual Network** – The Azure virtual network that Azure Migrate will assign the VMs to.
*   **Subnet** – The network subnet Azure Migrate will assign to the VMs.
*   **Availability options** – Optional [infrastructure redundancy](https://docs.microsoft.com/en-us/azure/security/fundamentals/infrastructure-availability) to apply to the VMs. This tutorial will select **No infrastructure redundancy required**.

> _You can pin the migrated VM to a specific [Availability Zone](https://azure.microsoft.com/en-gb/global-infrastructure/availability-zones/) or place it in an [Availability Set](https://docs.microsoft.com/en-us/azure/virtual-machines/availability) during this process or carry this out step post-migration if required._

*   **Azure Hybrid benefit** – An option to enable only if you have an [eligible Windows Server license](https://azure.microsoft.com/en-gb/pricing/hybrid-benefit/).Click **Next** to go to the **Compute** section to select VM sizes to create.

![Setting target networks and storage accounts](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T105658.891.png)

Setting target networks and storage accounts

5\. In the **Compute** section, define the desired name you’d like the Azure VM to have, the size of the VM, the operating system, and the OS disk.

Leave the default **Azure VM Size** option to **Automatically select matching size** to allow Azure to select the most appropriate size for your VM based on the initial assessment.

Click **Next** to head to the **Disks** section.

![Compute selection](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T105804.733.png)

Compute selection

6\. In the **Disks** section, choose **All selected** to ensure Azure migrates all of the volumes attached to the Hyper-V VM and click **Next** to navigate to the **Tags** section.

> _You can migrate specific disks from your Hyper-V VM by selecting the disks you want using the drop-down in the **Disks To Replicate** column._

![Disk selection](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T105903.532.png)

Disk selection

7\. In the **Tags** section, add any [tags](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources) required by your organization and click **Next**.

![Adding tags](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T105948.672.png)

Adding tags

Now, on the **Review + Start replication** section, click **Replicate** to replicate the virtual machine to Azure!

![Ready to replicate on premises vm to Azure](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110030.624.png)

Ready to replicate on premises vm to Azure

9\. Navigate back to the Azure Migrate hub. After a few minutes, you should see the new VM show up under **Replicating Servers**, as shown below.

![Replicating servers status page](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110109.406.png)

Replicating servers status page

10\. Click on the value to the right of **Replicating Servers** to open the list of currently replicating servers. You should see your server shown below.

During replication, the VM will temporarily be held in the storage account defined in step four.

![Replicating Machines management page](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110539.173.png)

Replicating Machines management page

## Performing a Test Migration

At last! You are now ready to create a virtual machine using the replicated data from ASR. But hold on a minute! You have one more step. You should now perform a test migration. A test migration performs a dry-run to confirm that the migration will work as expected.

> _A test migration will have no impact on the existing on-premises Hyper-V VM(s)._

1\. Navigate to the Azure Migrate hub again, and click on the **Server Migration** blade. Next, find the replication job you previously kicked off, click the **ellipses** next to the job and click **Test migration**.

![Running a test migration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110725.820.png)

Running a test migration

2\. On the **Test migration** screen, select the virtual network you defined in step four of the _Replicating Virtual Machines into Azure_ section. This tutorial is using a virtual network called **mig\_network.** When complete, click on **Test migration**.

![Starting a test migration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110807.327.png)

Starting a test migration

3\. Once the test migration starts, click on **Refresh** until you see the updated **Status** of the test migration shown below.

Click on the current status **Initiating test failover** to observe the stages of the test migration.

![Replicating machines management page ](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T110858.737.png)

Replicating machines management page

During this test migration process, Azure will create all of the required resources for your virtual machine and puts them in your chosen resource group.

![Stages of test replication](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111006.759.png)

Stages of test replication

4\. When the test migration completes, navigate to the Azure Portal and open the resource group you defined to create the Azure VM(s) in. You should see the VM resource and all related resources, such as the VM’s network interface and disk.

> _During the test migration process, the name of the VM is appended with **\-test.**_

Click into each resource to see each resource’s configuration to review each resource without committing to the actual migration yet.

![In the resource group with test resources present](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111131.495.png)

In the resource group with test resources present

6\. Finally, navigate back to the Azure migration blade, select the **ellipsis** next to the test migration and click **Clean Up Test Migration**. This action removes the test virtual machine and all associated temporary resources.

![Removing test resources](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111222.217.png)

Removing test resources

## Performing a Live Migration

Congratulations! You’ve finally come to the point actually to create an Azure from an on-prem Hyper-V VM. It’s now time to perform a cutover migration which will by default shutdown the on-premises virtual machine, then perform an on-demand replication that synchronizes any VM changes since the last replication.

After the migration job completes you can view and manage your VM from the Virtual Machines blade.

1.  Navigate to the Azure Migrate hub again and click on the **Server Migration** blade. Next, click on the **Migrate** button on the far right to open the migration wizard.

![Selecting live migration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111332.764-1.png)

Selecting live migration

2\. On the **Migrate** blade, optionally select **Yes** from the drop-down box to shut down the on-premises Hyper-V VM before migration. Shutting down the Hyper-V VM ensures that all changes to the Hyper-V VM are synchronized before Azure Migrate starts the Azure VM.

![Shutdown on premises vm before migration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111446.143.png)

Shutdown on premises vm before migration

3\. After a few minutes, refresh the **Migrate** page. You will notice that the Hyper-V VM shuts down, and the tiles on the **Migrate** page have now been updated to show that you have a migrated server!

![Migration complete](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111526.672.png)

Migration complete

4\. Finally, navigate to your resource group in the Azure Portal. You should now see that Azure Migrate created the Azure VM and all associated components just like you saw when performing the test migration.

![Server up and running after migration](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-2021-05-26T111605.864.png)

Server up and running after migration

## Cleaning Up

Once you’ve successfully migrated your Hyper-V VM to Azure with Azure Migrate, you only have a couple of final house cleaning tasks to do.

1.  Navigate to the Azure Migrate hub again and select **Azure Migrate —> Server Migration.**
2.  Clean up the Azure Migrate migration by right-clicking on the **VM** that Azure Migrate just created and select **Stop Migration**. This action stops the on-premises synchronization, removes the VM from the running count of replicating servers, and cleans up the replication state information.
3.  To ensure the VM is optimized to work in Azure, install the Azure VM [Windows](https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/agent-windows) agent. This agent is normally installed by default when creating a VM through the Azure Portal. The agent’s primary role is enabling and executing [Azure Virtual Machine extensions](https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/overview) and also managing the interaction between the VM and the [Azure Fabric Controller](https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/get-started/what-is-azure).
4.  Finally, if you migrated the VM for testing purposes, don’t forget to [remove the VM resources or the entire resource group](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/delete-resource-group?tabs=azure-powershell).

Related: [How To Manage Hyper-V Host From A Non-Domain Windows Client](https://adamtheautomator.com/hyper-v-host/)

## Conclusion

In this tutorial, you have learned how to migrate a Hyper-V hosted virtual machine into Azure using the native tools provided in the Azure Migrate project portal. In addition, you’ve learned all of the steps starting from replication, test migration, and finally, a full cutover migration.

Armed with your new knowledge, you can confidently take your first steps to lift and shift those [snowflake servers](https://www.sumologic.com/blog/snowflake-configurations-and-devops-automation/)! So which VM will you migrate first?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fazure-migrate%2F&text=How%20to%20Move%20a%20Hyper-V%20VM%20to%20Azure%20with%20Azure%20Migrate%20%5BGuide%5D)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fazure-migrate%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fazure-migrate%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2021/05/How-to-Prep-a-Hyper-V-VM-with-the-Azure-Migration-Assessment-Tool-1.jpg)

### [How to Prep a Hyper-V VM with the Azure Migration Assessment Tool](/azure-migration-assessment-tool/)

Learn how to use the Azure Migration Assessment Tool to prep a Hyper-V VM to migrate to Azure in this step-by-step guide.

![](https://adamtheautomator.com/wp-content/uploads/2023/05/veeam-azure.jpg)

### [How to Back up & Restore Azure VMs with Veeam azure Backup](/veeam-azure/)

Learn all the ins-and-outs of Veeam Azure backup and restore for virtual machines in this in-depth ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2021/08/How-to-Failover-an-Azure-Site-Recovery-Snapshot-Step-by-Step.jpg)

### [How to Failover an Azure Site Recovery Snapshot (Step by Step)](/azure-site-recovery/)

Learn how to perform a test failover and then progress to create azure site recovery with a two-stage failover and finally execute that plan for real.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
