Azure, add IP address to cloud service
Azure now supports multiple IP addresses per cloud service. This means you can, for example, host multiple websites, each running on a different IP address within one cloud service (1..n virtual machines).
Right now, it seems to be possible to manage this only via the Azure PowerShell cmdlets. After adding a secondary IP for my cloud service, I was no longer able to manage the endpoints via the Azure management website or the command line tools.
In brief, the commands to create a new reserved IP address and create a load balancer that uses the IP are as follows:
# Create a new reserved IP address
New-AzureReservedIP –ReservedIPName "MyIP" –Location "West Europe"
# Create load balancer and endpoints that use the reserved IP
# Here I'm adding it to two virtual machines which are part of the cloud service
Get-AzureVM -ServiceName myservice -Name vm01`
| Add-AzureEndpoint -Name myEndpoint -LoadBalancedEndpointSetName http`
-Protocol tcp -LocalPort 8001 -PublicPort 80 -VirtualIPName MyIP -DefaultProbe `
| Update-AzureVM
Get-AzureVM -ServiceName myservice -Name vm02`
| Add-AzureEndpoint -Name myEndpoint -LoadBalancedEndpointSetName http`
-Protocol tcp -LocalPort 8001 -PublicPort 80 -VirtualIPName MyIP -DefaultProbe `
| Update-AzureVM
# To see the endpoints for VM
Get-AzureVm -ServiceName myservice -name vm01 | Get-AzureEndpoint