Is My Static IP Address in Windows Azure Really Set?

I’ve been working with Windows Azure VMs since they became available last year, and I’ve built out some pretty complex scenarios with them (hybrid clusters using AlwaysOn Availability Groups, for one). One the early limitations was that all of the VMs were all dynamic IP (DHCP) addresses—there were some workarounds to this, but with database servers and domain controllers this wasn’t the best option. Starting early in 2014, a new PowerShell command called “Set-AzureStaticVNetIP” appeared on GitHub, and slowly made its way into the public domain. There’s a great article on how to configure this using Windows Azure PowerShell (which you will need to install after creating your VMs) at Windows IT Pro.

Note: This can only be done on Azure VMs in a virtual network

I’m in the middle of creating some VMs for some work that I am doing, and I went through the above process to assign a static IP to my domain controller in Azure. Pro tip—don’t set your IP address from within an RDP session to that machine. You will get kicked out (hangs head in shame). Also, make note that your machine may reboot—it’s not mentioned in the article, and I’m not 100% sure if it related to my being in the RDP session, but be forewarned.

As I was promoting it to a domain controller, I noticed that Windows still thought it had a dynamic IP address. Which I thought was odd.

Figure 1 Server Manager Showing Dynamic IP

From there I checked the IPv4 properties (note—this server has been promoted to a domain controller, why it is using localhost (127.0.0.1) and the other domain controller for DNS)

Figure 2 IPv4 Properties of AzureVM with Static IP

Of course, the proof was in the pudding—I had rebooted this VM several times and it was still keeping the same IP address (10.0.1.4). In the traditional dynamic IP address model, each DHCP call would increment by 1—so by my third reboot I would expect to see 10.0.1.7. So I went to Powershell to check using the command “Get-AzureStaticVNetIP”:

 

Figure 3 Static IP Address Assigned to VM.

So even though in most places it doesn’t look like your VM has a static IP address, it has been reserved on the Azure side. I think this is likely being done at the hypervisor level somehow, and hasn’t been exposed to Windows yet, but that’s just speculation on my part.

 

 

%d bloggers like this: