Azure中的IP安全性和始终开启设置

问题描述 投票:5回答:1

我在Azure Web应用程序上运行连续的WebJob,这要求我保持应用程序“始终开启”。在同一个应用程序中,我设置了web.config文件来阻止NotFound错误的未列出的IP:

<security>
  <ipSecurity allowUnlisted="false" denyAction="NotFound">
    <add ipAddress="123.456.789.123" allowed="true"/> <!--office-->
    <add ipAddress="168.62.180.0" allowed="true"/> <!--azure (for Always On setting)-->
  </ipSecurity>
</security>

显然,Always On设置会导致Azure在后台每隔5分钟ping一次网站,但安全选项会阻止Azure的ping,这会使错误日志变得混乱。其他白名单IP地址可以很好地访问应用程序;它只是被阻止的Azure ping。

这是来自其中一个被阻止的ping的错误日志的屏幕截图:

App insights log of 404 for get request to /

任何有关如何允许在Azure ping中的见解将不胜感激!

asp.net azure security web-config
1个回答
1
投票

允许这两个IP对我有用。由于Always on的ping来自“:: 1”ip,但是我还在列表中添加了“127.0.0.1”。

<add allowed="true" ipAddress="::1" />
<add allowed="true" ipAddress="127.0.0.1" />
© www.soinside.com 2019 - 2024. All rights reserved.