Azure Web作业无法连接到存储帐户

标签 azure azure-storage azure-webjobs

在 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/

相关文章:

azure - 在 Azure DocumentDB 中,如何获取集合中所有属性的列表?

azure - 使用 Azure 存储 blob URI 作为网站 Assets (即可链接)的一部分是否是个好主意?

shell - 使用 wget 下载文件时如何仅使用文件名保存文件

kubernetes - 将本地文件复制到 aks 高级或标准存储

c# - Azure Webjob TimerTrigger 不工作

json - Invoke-Webrequest 不正确的 Json 格式 "Cannot bind parameter ' headers' "

powershell - 使用 PowerShell 从 Azure 资源组导出类型

.net - 检索通过 SendGrid 发送的电子邮件的状态

azure - 为什么 webjob 日志没有显示正确的失败消息?

Azure webjobs不读取网站应用程序设置