AzureHow To

Azure | Move an Azure VM between subscriptions (Azure Classic Environment)

You may be aware that all of your data is stored in something called a ‘Blob Storage Account’. Each Azure subscription can have many blob storage accounts but not the other way around. You cannot share blob storage accounts between Azure subscriptions. That means there’s no easy way to move VMs around between Azure subscriptions through the website or PowerShell. However, it is fairly easy to do through an app. This tutorial will guide you through the process of moving VMs between Azure subscriptions.

NOTE: THE VM MUST BE SHUT DOWN BEFORE YOU DO THIS. If you still receive an error about a lease existing on the VHD, delete the VM but click Keep the attached disks and try again after a few minutes.

Screen Shot 2015-10-07 at 18.11.12

Step 1: Download and install CloudBerry Explorer.

CloudBerry Explorer is a free tool that one can use to move things around between Blob accounts. It’s not the only way to do it but it is one of the easiest.

Click Download Freeware on this page and register for a free account when you first open up the software.

Step 2: Add your Azure Blob accounts.

Add your accounts by going to File >> Add New Azure Blob Storage Account. It may prompt you to add another after adding your first account but if it doesn’t, just add another as before.

Screen Shot 2015-10-07 at 17.41.07

To add your accounts all you need to do is head to the Azure Portal, click on the Azure Storage Account you want and then click Manage Keys.

Screen Shot 2015-10-07 at 18.18.33

If the Azure subscription you want to move your VM over to doesn’t have an existing storage account, you can quickly create one by clicking New (in the bottom left of the Azure Portal) >> Data Services >> Storage.

Screen Shot 2015-10-07 at 18.19.47

Then just pick the accounts you want to use under each of the Source sections and click your way through the directory the VHD is currently located on the left panel and the destination panel on the right. If there aren’t any containers on the destination blob storage account (the root directory should have a container called vids (or something similar) listed), create one by clicking on this Screen Shot 2015-10-07 at 17.48.38icon.

Screen Shot 2015-10-07 at 17.43.28

Step 3: Move your VHD.

Once you’ve got the VHD you want to move listed in the panel on the left and the destination panel on the right, click on the VHD you want to move and then click Move. If you wish to keep the VHD on your old Azure account too, click Copy instead.

Screen Shot 2015-10-07 at 17.53.24

Step 4: Create a new disk.

Once the transfer is complete, head to Virtual Machines and then DISKS on the Azure Portal. Screen Shot 2015-10-07 at 18.00.04

Then you’ll need to click CREATE down the bottom and fill in the appropriate details. Make sure you tick The VHD contains an operating system.

Screen Shot 2015-10-07 at 18.00.47

Step 5: Create the VM.

Lastly all you need to do is click New in the bottom left, then From Gallery and lastly you need to pick My Disks on the left and then pick your VHD. Once you do that, just create the VM as usual.

Screen Shot 2015-10-07 at 18.02.26

Final Notes:

You can also use open-sourced tools to do this. Azure Storage Explorer (available here from CodePlex) is my favourite. Just add your accounts and download the VHD in question and re-upload to the account you want.

Jonathan Procter

Linux, Unix, and Windows server sysadmin.

Related Articles

Back to top button