Can an Azure VM be moved between virtual networks
August 3, 2017
Q. Can I move an Azure VM between virtual networks?
A. Historically it was not possible to move a vmNIC between virtual networks, only virtual subnets however it is possible to add and remove NICs post creation and so a possible solution to this approach would seem to be as follows:
Turn off NLA requirement in the Remote tab of System control panel applet (sysdm.cpl) before changing the virtual network
Deallocate the VM
Add a new NIC to the VM on the desired virtual network and virtual subnet
Change the primary NIC to the newly added NIC
Remove the old NIC from the VM
Start the VM
For the exact commands required see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/multiple-nics. Unfortunately this still does not work! The Azure fabric will not allow a VM to be connected to different virtual networks at the same time, even when the VM is deprovisioned and so this approach will not work and you always have to have at least one NIC attached to a VM so you cannot remove the VM first.
This means the only way to move a VM between virtual networks is to delete it, keep its storage and create a new VM connected to the correct virtual network using the existing disks.
About the Author
You May Also Like