从部署的应用程序获取Azure的公共IP地址 [英] Get Azure public IP address from deployed app
问题描述
我实施了 FTP
服务器 PASV
模式,我发送给客户端的IP地址和数据的端口结束点。这是愚蠢的,因为IP实际上是在客户端已连接,所以IRE两个选项:
-
我如何能得到公众
IP
从给定的实例地址?不
在VIP
,但市民之一。 -
我怎么能得到原始目标
IP
解决用户从使用
一个插座
对象吗?考虑到路由器和负载平衡器在中间:P
要任何此类问题的答案会做,虽然可以工作...我可能会得到另一种方式公开 IP
地址做了 DNS
查找 myapp.cloudapp.net
?
第四个选择是使用Azure管理API库......不过,太麻烦了:P
干杯。
不知道如果你想通了这一点,但这里是我采取它。各个角色实例都落后于Windows Azure的负载均衡,而且不知道原来的,外向的IP地址是什么。此外,还有一个返回的IP地址没有管理API调用 - 获取部署返回URL而不是IP地址。我认为唯一的选择将是一个DNS查询。
说到这里:我不认为你可以在你的角色实例托管被动FTP服务器(至少不武)。你可以打开25个输入端点您的角色(从5 - 见我最近的博客文章有关此更新的),但有参与配置手动工作。我不知道,如果你的FTP应用程序可以让你限制你的端口范围如此小的端口数。另外:
- 您不得不定义每个端口作为自己的输入端点(这是我所提到的手工劳动的一部分) - 输入端点不允许指定一个端口范围,不同的是内部端点
- 您不得不指定的内部使用的端口号,端口号将需要连续
这是ftp的最后一件事:你的应的能够举办SFTP服务器,没有麻烦,因为所有的流量来自通过一个端口
I'm implementing the PASV
mode in a FTP
server, and I send to the client the IP address and port of the data end point. This is stupid because the IP is actually where the client is already connecting, so there ire two options:
How could I get the public
IP
address from a given instance? Not theVIP
, but the public one.How could I get the original target
IP
address that the user used from aSocket
object? Considering routers and load balancers in the middle :P
An answer to any of this questions would do, although there is another way that could work... may I get the public IP
address doing a DNS
look up of myapp.cloudapp.net
?
A fourth option would be use the Azure Management API library... but, too much trouble :P.
Cheers.
Not sure if you ever figured this out, but here's my take on it. The individual role instances are all behind the Windows Azure load balancer and have no idea what the original, outward-facing IP address is. Also, there's no Management API call that returns IP address - Get Deployment returns the URL but not the IP address. I think the only option is going to be a dns lookup.
Having said that: I don't think you can host a passive ftp server in your role instance (at least not elegantly). You may open up to 25 input endpoints on your role (up from 5 - see my recent blog post about this update), but there's manual work involved in the configuration. I don't know if your ftp application lets you limit your port range to such a small number of ports. Also:
- You'd have to define each port as its own input endpoint (this is the manual labor part I mentioned) - input endpoints don't allow a port range to be specified, unlike the internal endpoints.
- You'd have to specify the port number that's used internally, and the port numbers would need to be sequential
One last thing on ftp: you should be able to host an sftp server with no trouble, since all traffic comes through one port.
这篇关于从部署的应用程序获取Azure的公共IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!