One of the challenges of deploying an VM within Azure is the fact that it’s IP Address is DHCP issued. Obviously this can be an issue for VM’s that hold Services that require a static IP address (Domain Controller, DNS Server, Exchange Server, etc.) Although setting an Azure VM’s IP Address to to Static is not supported, we can set it to use a DHCP reservation. This reservation will ensure that the VM always get the same IP Address. This can be accomplished by using the Azure Preview Portal. The steps for this are listed below:
Warning: The steps below will result in a New Network Adapter being provisioned for the VM and therefore will cause downtime. Only perform this operation during a planned maintenance window or within a lab environment.
- Navigate to portal.azure.com
- In the Left-Pane select Browse.
- Scroll down and select Virtual machines.
- In the Middle-Pane select the Virtual Machine that you will be assigning the Static IP to.
- In the Virtual Machine – Pane select Settings.
- Under the Settings – Pane select IP addresses.
- Under the IP addresses – Pane under the Private IP address section select Static for IP address assignment, then under IP address enter the Static IP Address that you would like to use.
- Click on the Save button at the top of the IP addresses – Pane then Click Yes to Confirm.
Once these steps have been completed the IP of the VM will stay the same throughout it’s life, unless you manually change it. This will also keep the IP Address reserved for Shutdown (Deallocated) VM’s as well.