【发布时间】:2016-03-14 22:47:54
【问题描述】:
我在 Azure 中使用了一个暂存槽,我只允许一些 IP 访问它。我在 web.config 文件中编写了以下规则:
<rule name="Block unauthorized traffic to staging sites" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^mydomain\-mydomainslot1\."/>
<!-- white listed IP addresses -->
<add input="{REMOTE_ADDR}" pattern="ip1" negate="true"/>
<add input="{REMOTE_ADDR}" pattern="ip2" negate="true"/>
</conditions>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden"
statusDescription="Site is not accessible" />
</rule>
插槽接受来自我的域 ip1 和 ip2 的流量。但是,我有一个网络作业(在插槽中),它使 PostAsJsonAsync 调用插槽 url,并且我收到一个禁止作为答案。我不知道 webjob 的 IP 地址(它应该与网站/插槽相同),但无论如何,我没有在规则中使用它的静态 IP 地址。我应该如何解决这个问题?是否有另一种方法可以在不保留 Azure 中的 IP 的情况下解决此问题?
【问题讨论】:
标签: azure web-config azure-webjobs azure-deployment-slots