Azure VM: Adding a Reserved IP address to an existing VM

Oxon picture Oxon · Feb 11, 2015 · Viewed 21.5k times · Source

What I have read so far on the web is that there is no way to add a reserved IP to an existing VM (unless I recreate the VM which I am trying to avoid). However, I have noticed that external IP of my VM and the cloud service is same.

  1. Reserved IP Addresses page explains how to "To use a Reserved IP with Cloud Services". I have looked everywhere in the Azure Management Portal but couldn't find a configuration setting for Service Configuration Schema.

  2. I am using the Azure scheduler to turn-off the VMs at night and on the weekends. From the following I understand is that there is something that I need to write in the scheduler script to re-assign the Reserved IP when the VM starts in the morning. Did I get it right?

    Shutdown VM - Previously, when all the Virtual Machine instances in a cloud service were moved to the Shutdown state (stop/deallocated), the public IP would be released and a new public IP would be assigned when one of the Virtual Machines instances was started. However, with this release, if the VM uses a Reserved IP, then the Reserved IP can be used when re-deploying the VMs.

P.S. Is Stack Overflow the best place to ask this sort of questions relating to Azure or shall I use Server Fault in the future? I have seen Azure questions in both websites.

Answer

artfulhacker picture artfulhacker · Aug 23, 2015

At Build 2015 they announced this is now possible and VERY easy. Simply open Azure powershell and run this:

New-AzureReservedIP -ReservedIPName "ipname" -Location "West US" -ServiceName "somevm"

If you run this it will reserve an IP named "ipname" and associate it with the already deployed instance "somevm.cloudapp.net"