I've got an FTP server running on Azure. I had to manually add in 20 endpoints for the 'data' connection.
It was painful.
Surely there's a better way to bulk add endpoints to an Azure VM, somehow? If so, could someone list some instructions? I'm open to anything.
eg. I would love to create
TCP public port 61020 - private port 61020
to
TCP public port 61100 - private port 61100
hmmm....
You can do this with PowerShell. A just tested script:
Add-AzureAccount
Select-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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With