Tuesday, July 7, 2015

Reserve public IP address for Microsoft Azure cloud service

By default, Microsoft Azure doesn't reserve any public IP address for your cloud service. The public IP address which is linked to your cloud service or virtual machine will be changed when the resources are shut down or deallocated.



Microsoft Azure provided reserve the IP address for your cloud service. By default, all Azure subscriptions are authorized to use 20 reserved IPs but we can submit a request to maximize to 100 IPs.

In this part, I'm going to reserve a public IP address for Azure cloud service.

Prerequisites
  • Azure PowerShell module on your computer
We can perform Get-AzureReservedIP to check reserved public IP addressed on your Azure subscription.


At this moment, I haven't reserved any public IP address. Then, I perform New-AzureReservedIP -ReservedIPName RWUSPIP01 -Location "West US" to reserve a public IP address from Microsoft Azure.



Remark: We cannot specific a Public IP address for reservation.



Now, we can associate the reserved public IP address to a cloud service by performing Set-AzureReservedIPAssociation -ReservedIPName RWUSPIP01 -ServiceName <Cloud Service Name>.


Microsoft Azure takes some times to update the public IP address for your cloud service.

Remark: Make sure the Azure Cloud Service is running. If not, you get the following error message.

The vip for deployment <deployemnt Name> in service <Cloud service name> specified for reserved ip <Reserved IP Name> is not set. Ensure that the deployment is Running.


Perform Get-AzureReservedIP to verify it.


We cannot assign 2 reserved IP address to the same cloud service.


To remove the reserved IP association from the cloud service, we can perform Remove-AzureReservedIPAssociation -ReservedIPName <Reserved IP Name> -ServiceName <Cloud Service Name>.


To release the reserved public IP address, we can perform Remove-AzureReservedIP -ReservedIPName <Reserved IP Name>.


To associate the reserved IP address to a new cloud service, we can perform the following cmdlets.

New-AzureReservedIP -ReservedIPName <Reserved IP Name> -Location <Location>

New-AzureVMConfig -Name <VM Name> -ImageName (Get-AzureVMImage | Where {$_.label -match 'Windows Server 2012 R2 datacenter' -and $_.PublishedDate -eq '5/22/2015 3:00:00 PM'}).ImageName -InstanceSize Small | Add-AzureProvisioningConfig -Windows -AdminUsername <Admin user name> -Password <password> | New-AzureVM -ServiceName <Cloud Service Name> -ReservedIPName <Reserved IP Name> -Location <Location>


For More information, please read Reserved IP Overview

This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment