【问题标题】:Azure Functions - Ping Restrictions?Azure Functions - Ping 限制?
【发布时间】:2017-11-15 21:45:15
【问题描述】:

我正在编写一个 Azure 函数来 ping 特定主机以使用 System.Net.NetworkInformation.Ping 类检查响应时间。调用 Ping.Send 时出现一般异常,但这在本地运行良好。

从 Azure Functions 出站的网络调用是否有限制?

我得到的例外很简单:

无法 ping:Ping 请求期间发生异常。
在 System.Net.NetworkInformation.Ping.Send(IP 地址地址,Int32 超时,字节 [] 缓冲区,PingOptions 选项) 在 System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options

【问题讨论】:

  • 听起来像 sandbox - "通过 Internet 访问应用程序的唯一方法是通过已经公开的 HTTP (80) 和 HTTPS (443) TCP 端口;应用程序可能不要在其他端口上侦听来自 Internet 的数据包。”

标签: c# azure


【解决方案1】:

由于 ICMP 协议不允许通过 Azure,因此您将无法从 Internet ping Azure VM,并且从 Azure VM 内,您无法 ping Internet 位置。

要测试连通性,建议进行端口 ping。虽然 Ping.exe 使用 ICMP,但其他工具(例如 PsPing、Nmap 或 Telnet)允许您测试与特定 TCP 端口的连接。

这篇文章很好地解释了这一点 - https://blogs.msdn.microsoft.com/mast/2014/06/22/use-port-pings-instead-of-icmp-to-test-azure-vm-connectivity/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-30
    • 1970-01-01
    • 2017-11-20
    • 2017-07-03
    • 1970-01-01
    • 1970-01-01
    • 2022-06-16
    • 2020-07-28
    相关资源
    最近更新 更多