【发布时间】:2021-07-29 17:09:28
【问题描述】:
我们的应用服务器被存储帐户拒绝。
我们生成了正确的 SAS 令牌,我们可以在本地访问容器。 (码头工人,intelliJ,邮递员)
- 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 时区运行。
【问题讨论】:
-
这个错误很可能是由于防火墙规则而出现的。因此,不允许您的 WebApp 访问您的存储帐户。
-
我在存储帐户中添加了我的防火墙设置的图片。
-
哦,所以你没有定义任何防火墙规则。只是为了确认一下,您可以使用本地的 SAS URL 访问相同的存储帐户吗?可以分享一下 SAS 网址吗?只需混淆您的 SAS URL 的帐户名称、容器名称和 sig 部分。
-
您的 SAS 令牌看起来不错。你能回答我的其他问题吗?
-
我可以知道您的应用服务如何获取此 SAS 令牌吗?
标签: azure azure-functions azure-web-app-service azure-storage-account