首页 > 解决方案 > 使用共享访问签名从 Azure Blob 服务访问 Blob 时是否可以定义自定义错误?

问题描述

我有一个显示从 blob 存储中检索到的图像的客户端应用程序。Blob 受 SAS 签名保护。当对 blob 的访问过期时,blob 服务会返回如下错误消息。

<Error>
    <Code>AuthenticationFailed</Code>
    <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:399b5e5d-d01e-0022-0813-cb9080000000 Time:2020-01-14T19:45:06.9253703Z
    </Message>
    <AuthenticationErrorDetail>Signed expiry time [Fri, 22 Nov 2019 11:27:07 GMT] must be after signed start time [Tue, 14 Jan 2020 19:45:06 GMT]
    </AuthenticationErrorDetail>
</Error>

是否可以自定义 blob 服务返回的此错误消息?

标签: azureazure-blob-storage

解决方案


除非您使用 API 来提供 blob,否则您将无法拦截/更改来自 Azure 存储服务的响应。


推荐阅读