Answered by:
VM EndPoint and Port Range

Question
-
I have to allow around 100 ports into my recently installed Azure Windows 2008 VM. I am able to create endpoint rules to allow individual ports, but not for range of ports. Is there a way to do that?Wednesday, June 20, 2012 7:51 PM
Answers
-
For public endpoint, there is no port range definition supported. The workaround is you can use Azure Powershell and script each endpoint.
- Proposed as answer by Craig LandisMicrosoft employee Thursday, June 21, 2012 1:13 AM
- Marked as answer by Luzicarp Thursday, June 21, 2012 12:36 PM
Thursday, June 21, 2012 12:32 AM
All replies
-
For public endpoint, there is no port range definition supported. The workaround is you can use Azure Powershell and script each endpoint.
- Proposed as answer by Craig LandisMicrosoft employee Thursday, June 21, 2012 1:13 AM
- Marked as answer by Luzicarp Thursday, June 21, 2012 12:36 PM
Thursday, June 21, 2012 12:32 AM -
Hey Luzicarp,
To add to Richard's reply, for each Virtual Machine you are limited to a total of 25 endpoints which means you will hit this limit well before you reac your 100 port goal. This is an area we are working on...
Corey
Thursday, June 21, 2012 7:41 AM -
Thanks Corey and Richard. Is there a public roadmap or a forum/maillist that will inform when new features are in place? Thanks for both your answers.Thursday, June 21, 2012 12:38 PM
-
Hey Luzicarp,
We typically do most of our announcements using the Windows Azure blog found here: http://www.windowsazure.com/en-us/community/blog/
In fact, I am going to have a blog post up there next week but not announcing any new features. :)
Corey
Friday, June 22, 2012 8:54 AM -
I'm with the same problem as luzicarp...
i'm trying to host a server that requires more ports and i'm not sure how to make it fit on 25 endpoints...
Monday, August 6, 2012 2:17 AM -
Hello Corey,
How it is going with the 25 endpoints limitation for each VM?
I understand limitation is per VM...
So to achieve 48 ports, one way is to provision 2 VM in same cloud service and open 24 ports on each machine,
So VM1 will have 10000-10023 and VM2 10024-10048, and all of this 48 ports will be accesible under the same [cloudservicename].cloudapp.net address even if there is two VM.
Is this right?
Thank you so much in advance.
jesus
Thursday, August 16, 2012 11:47 PM -
For public endpoint, there is no port range definition supported. The workaround is you can use Azure Powershell and script each endpoint.
Anyone have a sample script I can use?Regards, Bill
Wednesday, November 14, 2012 12:40 AM -
Hello Bill
Next script opens ports from 9000-9002-9004 to 9100 given a cloud service and a vm_name
$i=9000
do
{ Get-AzureVM -ServiceName "[CLOUD_SERVICE_NAME]" -Name "[VM_NAME]" | Add-AzureEndpoint -LocalPort $i -PublicPort $i -Name TCP$i -Protocol TCP | Update-AzureVM; $i+=2}
until ($i -gt 9100 )regards
- Edited by VS Anywhere Monday, November 19, 2012 3:08 PM
Monday, November 19, 2012 3:08 PM -
Hello,
For other people that could read this thread:
There is no limitation of 25 ports by cloud service in Azure or VM, you can open as many ports as you want.
You can use a script like this: (from 9000 to 9100/increments of two, so 9000-9002-9004)
$i=9000
do
{ Get-AzureVM -ServiceName "[CLOUD_SERVICE_NAME]" -Name "[VM_NAME]" | Add-AzureEndpoint -LocalPort $i -PublicPort $i -Name TCP$i -Protocol TCP | Update-AzureVM; $i+=2}
until ($i -gt 9100 )Regards
- Proposed as answer by VS Anywhere Monday, November 19, 2012 3:11 PM
- Edited by VS Anywhere Monday, November 19, 2012 3:12 PM
Monday, November 19, 2012 3:11 PM -
Just to continue this thread, the max number of endpoints appears to now be 150 which unfortunately is still not enough for my scenario.
If you run the Powershell commands in the previous post, once you reach 150 endpoints created, the Update-AzureVM cmdlet will start throwing an exception.
Devin
Wednesday, November 28, 2012 12:59 AM -
Hello Devin,
Well in my use case I'll never reach the 150 endpoints by VM but is good to know there is such limitation.
Because I understand you want to open > 150 endpoints to the same VM, (not the cloud service itself), right?
Regards
Jesus
Wednesday, November 28, 2012 3:12 PM -
You can add the endpoints all in one shot, example:
$vm = Get-AzureVM -ServiceName "SvcName" -Name "VmName";
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP1" -Protocol "tcp" -LocalPort 49152 -PublicPort 49152
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP2" -Protocol "tcp" -LocalPort 49153 -PublicPort 49153
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP3" -Protocol "tcp" -LocalPort 49154 -PublicPort 49154
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP4" -Protocol "tcp" -LocalPort 49155 -PublicPort 49155
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP5" -Protocol "tcp" -LocalPort 49156 -PublicPort 49156
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP6" -Protocol "tcp" -LocalPort 49157 -PublicPort 49157
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP7" -Protocol "tcp" -LocalPort 49158 -PublicPort 49158
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP8" -Protocol "tcp" -LocalPort 49159 -PublicPort 49159
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP9" -Protocol "tcp" -LocalPort 49160 -PublicPort 49160
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP10" -Protocol "tcp" -LocalPort 49161 -PublicPort 49161
$vm | Add-AzureEndpoint -Name "zPASSIVEFTP11" -Protocol "tcp" -LocalPort 49162 -PublicPort 49162
$vm | Update-AzureVMTuesday, August 27, 2013 9:08 AM -
Hello,
This is a good but very slow solution. ( Because of Azure of Course )
But why you write this little script to increment by 2 ?
Is there any rule that you followed ?
Thursday, January 30, 2014 3:40 PM -
You can do it with IaaS Management Studio (http://iaas.ao-is.com/)
It also generates the powershell script for you if you decide to script it.
Wednesday, February 5, 2014 4:11 PM -
Hi Craig,
It has been two years and this problem still persists. End point creation is terribly slow, and still one-at-a-time (AFAICT).
We have customers seeking to boot 1000 nodes, and each requires ~10 endpoints. It isn't pretty.
Is there any news on this front? Will it ever improve?
Wednesday, October 29, 2014 3:06 PM -
I too would like to open more ports. In particular, I need to open ports for mosh on linux. The default setup needs ports 60000-61000: https://mosh.mit.edu/
I've settled on opening a single port, but was surprised I wasn't allowed to open a port range.
Tuesday, December 16, 2014 3:30 PM -
Your little simple little script works beautifully. Well done! Thanks heaps :) ...I was wrestling with one that imports from CSV, couldn't make it work... wasted a day.Wednesday, December 9, 2015 4:23 AM