Microsoft is constantly improving its Azure cloud computing platform, and in spring this year a series of updates to Microsoft Azure PowerShell cmdlets made it much easier to assign VMs with a static IP address.
Prior to the spring round of updates to the Azure platform, the only way to assign a static IP address to a VM was to create the VM entirely using PowerShell. Now it’s possible to create a VM in the management portal and then configure a static IP address using PowerShell. In today’s Ask an Admin, I’ll show you an easy way to assign a static IP address in Microsoft Azure.
Start by creating a new VM using the Azure management portal. For more details on how to complete this task, see “Deploy Windows Server 2012 in an Azure Virtual Machine” on Petri IT Knowledgebase. You will also need to install the latest Windows Azure PowerShell cmdlets on your management workstation. The easiest way to do this is to download and install the Web Platform Installer. To set up a secure connection to your Azure subscription, see “Setup Windows Azure PowerShell Management.”
You will also need to have a virtual network already created in order to assign an IP address from its DHCP pool. For more information, see “Setup a Virtual Network in Windows Azure.” In this article, I created a couple of subnets specifically for servers that needed static IP addresses in a lab environment. This was to avoid having to create VMs using PowerShell. Now that it’s much easier to assign static IP addresses, you can create a virtual network with just one subnet and assign static IP addresses using the method below.
Now we are ready to use PowerShell to assign a static IP address. The instructions below are for Windows 8 or later.