诊断并排查 Azure Cosmos DB 的“已禁止”异常的问题Diagnose and troubleshoot Azure Cosmos DB forbidden exceptions

适用于: SQL API

HTTP 状态代码 403 表示已禁止完成请求。The HTTP status code 403 represents the request is forbidden to complete.

防火墙阻止请求Firewall blocking requests

在这种情况下,通常会看到如下错误:On this scenario, it's common to see errors like the ones below:

Request originated from client IP {...} through public internet. This is blocked by your Cosmos DB account firewall settings.
Request is blocked. Please check your authorization token and Cosmos DB account firewall settings

解决方案Solution

验证当前防火墙设置是否正确,并包括要尝试发起连接的 IP 或网络。Verify that your current firewall settings are correct and include the IPs or networks you are trying to connect from. 如果最近更新过这些设置,请记住,应用这些更改最多可能会需要 15 分钟。If you recently updated them, keep in mind that changes can take up to 15 minutes to apply.

后续步骤Next steps