Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

HOW TO: Change an Azure VM Subnet

  • December 9, 2015
  • 3 min read
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.

In this article, I will explain to you how to change the subnet of a Virtual Machine in Azure. Following is the official documentation on the Microsoft Website this documentation.

To do this, you must use PowerShell (this is the only possibility to do this, maybe in next versions, it will be possible to do this with the GUI). As you can see, my VM has the IP address 10.0.0.4:

1

My two subnets in my network are the following:

2

The VM is actually on the FrontEnd subnet and I would like to move it to the BackEnd subnet. To do this, execute the following PowerShell command:

Get-AzureVM -Name sql-001 -ServiceName Demo | Set-AzureSubnet -SubnetNames BackEnd | Update-AzureVM

3The VM will restart after the execution of the Update-AzureVM cmdlet. When it’s done, go back to your Azure VM interface. You can see that the new IP is in my BackEnd range:

4

Don’t forget to change the IP in your DNS too if you don’t allow DNS Dynamic Updates. In my VM, I have now  the same IP as in Azure Portal:

5
[ratings]

Found Florent’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!