How to Bulk-Add Azure endpoints? How to Bulk-Add Azure endpoints? azure azure

How to Bulk-Add Azure endpoints?


You can do this with PowerShell. A just tested script:

Add-AzureAccountSelect-AzureSubscription -SubscriptionName "Your_Subscription_Name"$vm = Get-AzureVM -ServiceName "CloudServiceName" -Name "VM_Name"for ($i=6100; $i -le 6120; $i++){    $EndpointName = "FtpEndpoint_"    $EndpointName += $i    Add-AzureEndpoint -Name $EndpointName -Protocol "tcp" -PublicPort $i -LocalPort $i -VM $vm}$vm | Update-AzureVM

The actuall service call is performed at bulk when you execute the Update-AzureVM

Starting point for Azure PowerShell reference is here.

I am sure you can achieve the same result also with the XPLAT-CLI.


Note that with the last batch of updates (May 2014) you can now map a fixed Public IP to a VM and avoid needing to use cloud service End Points completely. This preview feature requires you to provision a new VM to take advantage of it. The latest Azure PowerShell (0.8.2) also includes the necessary cmdlets to make this work.

New-AzureReservedIP -ReservedIPName EastUSVIP -Label "Reserved VIP in EastUS" -Location "East US" New-AzureVM -ServiceName "MyApp" -VMs <vm> -Location "East US" -VNetName VNetUSEast -ReservedIPName EastUSVIP

The above sample comes from Scott Guthrie's announcement here: http://weblogs.asp.net/scottgu/archive/2014/05/12/azure-vm-security-extensions-expressroute-ga-reserved-ips-internal-load-balancing-multi-site-to-site-vpns-storage-import-export-ga-new-smb-file-service-api-management-hybrid-connection-service-redis-cache-remote-apps-and-more.aspx