限制Azure网站的IP地址阻止我访问我的localhost

时间:2017-10-27 00:07:55

标签: asp.net-mvc azure azure-web-sites ip-address azure-web-app-service

我在配置文件中调用此代码,以便在我将网站发布到Azure时阻止除我的所有IP地址。

<security>
  <ipSecurity allowUnlisted="false" denyAction="NotFound">
    <add allowed="true" ipAddress="98.214.211.202" subnetMask="255.255.0.0"/>
  </ipSecurity>  
</security>

当我将我的网站发布到Azure时,这可以阻止除我以外的所有人,但是当我从localhost启动网站进行调试时,它似乎阻止了我的开发机器。

我需要在允许的地址中包含哪些IP地址来解锁我的dev(localhost)计算机?

我尝试了'127.0.0.1'而没有运气

1 个答案:

答案 0 :(得分:2)

不要在本地修改web.config,而是尝试通过Web App网络配置添加IP限制:

enter image description here

现在您可以添加特定的IP地址(或范围):

enter image description here

注意:免费共享层不支持此功能。

相关问题