如何解决存储帐户因 403 错误而拒绝 Azure 应用服务
我们的应用服务器被存储帐户拒绝。
我们生成了正确的 SAS 令牌,我们可以在本地访问容器。 (码头工人,智能,邮递员)
- WebbApp 和存储帐户位于同一位置(德国中西部 UTC+2)。
- 我们有标准订阅/计划
- 我们将容器设为公开。
- 我们为防火墙设置了 IP 地址。
- 我们使用 azure sdk java
我们尝试调用 Blob 服务。
当应用在 Azure 服务器上运行时,我们收到一条错误消息。
com.azure.storage.blob.models.BlobStorageException at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance
If you are using a SAS token,and the server returned an error message that says 'Signature did not match',you can compare the string to sign with the one generated by the SDK. To log the string to sign,pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.
Please remember to disable 'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.
Status code 403,"<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationFailure</Code><Message>This request is not authorized to perform this operation.
RequestId:959d813f-601e-0057-262f-4351a4000000
Time:2021-05-07T10:53:45.0157340Z</Message></Error>"
更新
我们将时区设置为 UTC-0。 它解决了我们的问题。服务在 UTC-0 时区运行。
解决方法
您应该检查两件事:
- 您如何获得此 SAS 令牌。
- 您是否在本地和远程之间使用了不同的容器。
如你所说,你可以在本地成功使用它,然后你可以尝试调试你的代码以获取sas uri值,并通过浏览器直接访问它。
最后,如果没有帮助,您可以尝试 generate the SAS token from portal,并将 sas 令牌硬编码到您的代码中。
,我们将时区设置为 UTC-0。它解决了我们的问题。服务在 UTC-0 时区运行。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。