This is part 13 of the Modernizing Your Infrastructure with Hybrid Cloud series. You can find find the rest of the series located here: http://aka.ms/ModernCloud

AzureVIPHopefully by now you have had a chance to use Microsoft Azure Virtual Machines and Websites. One of the things you might want for your server on the internet is an IP address that doesn’t change. You may want this to ensure your outbound traffic from your Azure server uses a predictable IP address. This will enable you to set a DNS record or a firewall rule with your dedicated IP address. Another benefit of reserving an address is that you keep your IP address even when you de-provision your virtual machine.

There are some important steps you need to pay attention to:

  • At this time, you can’t go back and apply a reservation to something that’s already been deployed, so you must reserve the IP address first, before deploying.
  • You reserve a Virtual IP and the VIP will stay with your cloud service.
  • There is a limit of 5 reserved IP addresses per standard subscription. Limit can be raised via a support request.
  • There is a limit of 100 reserved IP addresses per Enterprise Agreement subscription. Limit can be raised via a support request.
  • The first 5 actively used IP addresses are free. Otherwise IP addresses are about $4 a month.
    Pricing details here:  http://azure.microsoft.com/en-us/pricing/details/reserved-ip-addresses/
  • Reserved IP is supported only for Regional VNets. It is not supported for VNets that are associated with affinity groups. For more information about associating a VNet with a region or an affinity group, see About Regional VNets and Affinity Groups for Virtual Network.

Currently there is no way to reserve your IP address in the graphical web tools. That’s right you must use PowerShell. In the tables below are the commands that are available today to set IP addresses. The three main commands are:

Command Explanation
get-help *-AzureReservedIP* List all Azure reserved IP commands
Get-AzureReservedIP View all of your reserved IP addresses
New-AzureReservedIP Reserve a New IP address
Remove-AzureReservedIP Delete a Reservation

 

In the So lets take a look at using this on my Azure account:

Command Description
   
New-AzureReservedIP –ReservedIPName “MyServer1IP” –Label “Server1IP” –Location “West US”

image

Create a new reservation
This creates the reservation in the location specified. Once complete it is ready to use when creating a new VM.
Get-AzureReservedIP

image

List out my reserved IP addresses

Get-AzureReservedIP lists out the Azure Reserved IP addresses you have.

New-AzureQuickVM -Windows -ServiceName bjl3 -Name bjl3 -InstanceSize Small -ImageName “a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201408.01-en.us-127GB.vhd” -AdminUsername brian -Password Your$Random^Password#Here –ReservedIPName MyServer1IP –Location “West US”

image

Create a VM using the reservation

I used the quick create command-let to create my VM.

Get-AzureVMImage |  Select-Object -Property ImageName |  Out-GridView

image

Get the Platform Image Name

In the create command I used a platform Image but they keep getting updated and that name changes. So to get the current platform name I use the get-AzureImage command.
Once the Out-GridView window opened I set a filter of “windows-server-2012-r2” to narrow the list of images down. Then I used the image name in the Quick VM create command.

Get-AzureReservedIP

image

List out multiple addresses

Here I have two reserved IP addresses – the first is in use on a VM and the second is just reserved.

Remember you are charged for the unused IP address.

Remove-AzureReservedIP -ReservedIPName MyServer2IP

image

Remove a Reserved IP address

Removing a Reserved IP address is easy. Just give the reserved IP name and it’s gone.

 

Here are the commands from above that reserve your IP and then create your VM.

New-AzureReservedIP –ReservedIPName “MyServer1IP” –Label “Server1IP” –Location “West US”

New-AzureQuickVM -Windows -ServiceName bjl3 -Name bjl3 -InstanceSize Small -ImageName “a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201408.01-en.us-127GB.vhd” -AdminUsername brian -Password Your$Random^Password#Here –ReservedIPName MyServer1IP –Location “West US”

 

I hope that helps make it easy for you to reserve your IP address today for your Azure VMs!

-Brian

For more details see the articles below: