Step-By-Step: Move a VM to a different Vnet on Azure

Hello Folks,

On June 3rd, I wrote about moving Virtual machines from one subnet to another in one virtual network. following that I’ve received a ton of feedback. Some of it about how I missed the point of the original question.  “what about moving a current VM from one affinity to another affinity, or from one azure network to another? ”  Asked Ray though the comments on the original posts.

So, Ray, and everyone…  Here is how you move a VM from one Virtual Network to another.  We cant’ just move a virtual machine between networks like we did between subnets.  What we need to do is identify the disk used by the VM, delete the VM itself while retaining the disk, and recreate the VM in the target virtual network and attach the original disk to it.

Identify the disk used by a Virtual Machine

1- Log into the Azure portal.

2- In the virtual machines section of the Portal.  select the instance/VM that you want to move,


3- In the Dashboard pane for the virtual machine you want to move, scroll down to the disk section and note the disk/disks that your VM has attached to itself.

In my case the disk attached to the vm-test-01 virtual machine. is “VM-Test-01-VM-Test-01-0-201406140351230909”


Delete the existing Virtual Machine

4- while the virtual machine is still selected in the portal,  select Delete in the action bar at the bottom of the screen. ensure that you select “Keep the attached disks” 


5- Once Deleted, switch your focus in the portal to the Virtual Machines section and the Disk Pane and keep refreshing the screen until the field “Attached to” goes blank.


Create the new Virtual Machine

6- Once the disk reports that it’s not attached to anything.  it will also show up the “My Disks” portion of the gallery.  let’s create a new VM using that disk. by selecting in the Action bar.  New, Compute, Virtual Machine, From Gallery.


7- In the Gallery, select “My Disks” and select the disk that corresponds to the disk that was originally attached to the virtual machine we deleted.  in my case “VM-Test-01-VM-Test-01-0-201406140351230909”


8- Fill out the wizard with the name, tier, size …   until you get to the Cloud Service.  Once you get there you must create a new Cloud Service and select the new virtual Network and subnet you want has the new target for your new VM.  You Need a new cloud service because the Cloud Service is a boundary for a variety of settings such as:

  • Public IP Address space
  • Public DNS Name
  • Internet Firewall
  • Load Balancing

so switching the network will of course change the IP address space.  Once you’ve selected the new Cloud Service, pick the Virtual Network and the subnet you want. And complete the wizard to create the new VM.


once the machine is created you can validate the network by looking at the configuration of the VM.


There you go Ray.

you now know how to move a VM to another virtual Network.

I hope this helps.  let me know if ther is anything else I should look into.



Pierre Roman | Technology Evangelist
Twitter | Facebook | LinkedIn

Comments (2)

  1. Raymond says:

    Hey Pierre! Thank you for the illustrated and detailed answer/demonstration. Works very well, exactly what I was looking for! Just a small suggestion about your previous article (you had mentioned that you would address it eventually, but Ill jump the
    gun). Ive been trying to create a multi site VPN infrastructure between Azure itself and then with my on premise network. At the end of your previous documentation, you had screenshots of what the connections look like once established, but in the context
    of single connections. I tried implementing what I describe above, and was wondering how things would look like once implemented… It is different once you add more than one connection. It would be nice to see your docs with an extra, on premise connection.
    Before I implemented it, I was wondering what it would look like, I have a sense now, but its nice to be reinforced by other people's visuals… 🙂

    Thanks a bunch for your docs, they are very helpful!


  2. Pierre Roman says:

    Hello Raymond,

    Yes, I am working on that and I should have something documented soon.

    Thanks for the feedback


Skip to main content