By default, the VM’s that you create in Azure will have a dynamic virtual IP address (VIP). Based on this article on Azure, you could simply create a DNS CNAME record for your custom domain and point it to the DNS name that you chose during the creation of your azure VM which should prevent any problems if the virtual IP address happens to change.
Maybe you want a reserved virtual IP address for your Azure instance though? There’s a limited number of reserved virtual IP addresses per subscription so make sure you use them sparingly if you do indeed want to create and use reserved virtual IP addresses.
New-AzureReservedIP –ReservedIPName 'mikefrobbinsIP' –Location 'South Central US'
Get-AzureReservedIP PowerShell cmdlet can be used to see the actual IP address once the
reservation has been created. For security reasons, I’ve blurred out the actual IP address that was
created in the following example:
Get-AzureReservedIP –ReservedIPName 'mikefrobbinsIP'
The same cmdlet can be used to determine how many virtual IP addresses you’ve already reserved in Azure:
One of the catches is that you can’t assign a reserved virtual IP address to a VM that already exists in Azure. Based on what I’ve read this is something that they’re working on so it is subject to change.
Remove-AzureReservedIP cmdlet is used to remove a reserved virtual IP address. If it’s
currently in use (associated with an Azure cloud service), the removal will fail:
Get-AzureReservedIP -ReservedIPName mikefrobbinsIP | Remove-AzureReservedIP
Remove-AzureReservedIP : BadRequest: The Reserved IP mikefrobbinsIP is currently in use by Deployment mikefrobbins-test belonging to HostedService mikefrobbins-test. At line:1 char:54 + … ureReservedIP -ReservedIPName mikefrobbinsIP | Remove-AzureReservedIP + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Remove-AzureReservedIP], CloudException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.RemoveAzureReservedIPCmdlet
Based on my testing, even if you delete the VM and the Cloud Service that the reserved virtual IP address is associated with, the IP will remain reserved and associated with your Azure subscription.