Azure offers the ability to set static IP addresses for hosted virtual machines. I recently had to configure this for some of our existing “classic” Azure virtual machines. The process is as follows.

Setup Azure PowerShell Cmdlets

First download and install the Azure PowerShell cmdlets onto your local machine from here

The installation may require a reboot.



Fix PowerShell Proxy Authentication Issue

As I was doing this within a corporate environment I ran into issues with my local proxy server. If this doesn't apply to you then feel free to skip this step.

You might encounter the below 407 error when the Azure PowerShell Cmdlet bumps up against your proxy server.

PowerShell Proxy 407 Error

Run the below PowerShell command to fix the issue. It'll use your local network credentials to authenticate against your proxy server.

netsh winhttp import proxy source=ie
$webclient=New-Object System.Net.WebClient

Azure Account Login

Next log into your Azure account. The below command will launch a window prompting you to log into your Microsoft Azure account.


PowerShell Screenshot

Choose your Azure Subscription

If you have multiple Azure MSDN subscriptions (like me) you’ll need to choose the right one. It should be the same one where your existing VM’s are running.

Select-AzureSubscription -SubscriptionId "XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX"

PowerShell Screenshot

Assign Static IP to Classic VM

New-AzureReservedIP -ReservedIPName "<NAME FOR RESERVED IP RESOURCE>" -Location "Australia Southeast" -ServiceName "<NAME OF VM>"


New-AzureReservedIP -ReservedIPName "ShaneTempVMIp" -Location "Australia Southeast" -ServiceName "ShaneTempVM"

Azure Portal screenshot

PowerShell Screenshot



Your static IP should now be set up.

To confirm, head back into the Classic VM screen and ensure the IP ADDRESS ASSIGNMENT = ‘RESERVED'

Azure Portal Screenshot

Shane Bartholomeusz