如何批量添加Azure的终点? [英] How to Bulk-Add Azure endpoints?

查看:148
本文介绍了如何批量添加Azure的终点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有了Azure上运行FTP服务器。我不得不手动在20端点添加对数据连接。

I've got an FTP server running on Azure. I had to manually add in 20 endpoints for the 'data' connection.

这是痛苦的。

肯定有批量一种更好的方式添加端点蔚蓝的VM,不知何故?如果是这样,可能会有人列举了一些说明?我打开任何东西。

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.

如。我很想创建

TCP端口的公共61020 - 私有端口61020

TCP端口的公共61100 - 私有端口61100

嗯....

推荐答案

您可以使用PowerShell做到这一点。一个刚刚测试脚本:

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

在实际工作服务呼叫在散装当你执行执行更新 - AzureVM

有关Azure中的PowerShell参考出发点是这里

Starting point for Azure PowerShell reference is here.

我相信你也可以达到同样的效果与 XPLAT-CLI

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

这篇关于如何批量添加Azure的终点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆