gpt4 book ai didi

Azure documentdb 防火墙阻止了来自 Web 作业的访问

转载 作者:行者123 更新时间:2023-12-03 03:06:25 25 4
gpt4 key购买 nike

我尝试通过启用“启用 IP 访问控制”来启用 Azure DocumentDB 防火墙。

我设法允许来 self 的应用服务的连接。但是,驻留在应用服务上的 Webjob 无法访问 Azure DocumentDB。

有没有办法允许 Web 作业访问 DocumentDB?谢谢

最佳答案

Is there a way to allow web job access to the DocumentDB?

简而言之,。如果我们想要启用防火墙阻止访问策略,我们需要添加允许的IP地址或IP地址范围列表。我们可以从document获取更多信息。但 Azure WebApp IP 不是静态的。

all of access to your Azure Cosmos DB database account from machines outside the configured allowed list of IP address ranges are blocked

我设法允许来 self 的应用服务的连接

如果这意味着您已打开允许访问 Azure 门户。如果是这种情况,并不意味着我们可以从 Azure 其他服务访问 DocumentDB,而是意味着我们可以从 Azure 门户对帐户内的集合或文档执行操作。

Without portal access enabled, you will not be able to perform any operations on collections or documents within this account from the portal

总之,如果我们想要允许 Web 作业访问 DocumentDB,那么我们需要关闭启用 IP 访问控制。或者我们可以使用 Azure 云服务或虚拟机来代替 WebJob。

编辑:

根据您的评论,如果我们想使用与WebApp相同的IP,我们可以使用出站IP,我们可以从azure资源(https://resources.azure.com/)中获取它们,然后将outboundIpAddresses添加到DocumentDB允许的IP列表中。 然后webjob就可以访问DocumentDB了。

enter image description here

注意: outboundIpAddresses 不是静态 IP,当我们重新启动 WebApp 或更改 WebApp 服务计划时,它们可能会更改。

关于Azure documentdb 防火墙阻止了来自 Web 作业的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44131072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com