在 Azure 中,我有一个 Web 作业在 Web 应用程序中运行。在同一区域和资源组中,我还有一个存储帐户。通常,webjob 和 webapp 中的网站可以访问存储帐户。
出于安全原因,我尝试在存储帐户上启用防火墙设置,以便只有我的 Azure 资源可以访问该存储帐户。执行此操作后,Web 应用程序中的网站仍然可以访问存储帐户。但是,Web作业无法连接:Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回错误:(403) Forbidden。
由于 webjob 是 Webapp 的一部分,我将 WebApp 的出站 IP 地址添加到防火墙异常(exception)列表中(共有 5 个),但没有效果。网络作业是否有不同的出站 IP 地址?或者我在这里忘记了什么?
最佳答案
它不起作用,因为存储帐户和 Web 应用托管在同一区域。请参阅the docs :
IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests.
相关SO帖子:https://stackoverflow.com/a/59890919/1108916 , https://stackoverflow.com/a/56084447/1108916
关于Azure Web作业无法连接到存储帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52035709/