是否需要将 Azure IP 数据中心 IP 添加到应用服务白名单?

Is it necessary to add Azure IP datacenter IP's to app service whitelist?

我必须限制 public 访问我的 Azure 应用程序服务,因此我在 Web 配置中实现了 IP 白名单。是否需要将 Azure 数据中心 IP 范围列入白名单? 我的应用服务使用 Azure SQL、redis 和搜索服务。

  1. 对您的问题的简短回答是否定的,您不需要添加 Azure 数据中心 IP 地址来使用 Azure 服务。您需要将 IP 地址添加到允许列表的唯一情况是 service/application 尝试访问您的 Web 应用程序而不是相反。

  2. 鉴于您 objective 限制 public 访问,您绝对应该考虑使用 Azure 门户的 IP 限制功能。 Microsoft 改进了此功能,它比只有 web.config <ipsecurity> 配置更好,

    • Azure App Service IP 限制,流量甚至会被阻塞 在它到达您的 IIS 之前。
    • 您仍然可以继续按原样使用您的 web.config 配置。
    • 配置工作非常少,因为它都可以通过门户网站获得

在此处阅读更多相关信息 Azure App Service Static IP Restrictions

For a time, the IP Restrictions capability in the portal was a layer on top of the ipSecurity capability in IIS. The current IP Restrictions capability is different. You can still configure ipSecurity within your application web.config but the front-end based IP Restrictions rules will be applied before any traffic reaches IIS.