出现以下错误:
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
我正在使用WindowsAzure.Storage包来获取blob流,非常简单。
_blobClient = CloudStorageAccount
.Parse(options.ConnectionString)
.CreateCloudBlobClient();
var blob = _blobClient.GetContainerReference(containerName)
.GetBlobReference(blobName);
var file = await blob.OpenReadAsync(null, _requestOptions,
_context).ConfigureAwait(false);
我尝试使用帐户 key 和名称以及连接字符串,结果是相同的。
使用Azure存储资源管理器也会发生同样的情况,我无法将任何文件上传到存储。 (只是继续上传,进度为 0%)。仅当我直接连接到我的 Microsoft 帐户时才有效。
- 我的计算机时间和时区是自动设置的。
- 存储区域为东南亚、东亚
是否需要进行任何额外配置?
谢谢
最佳答案
我在 Android 模拟器中运行代码,其中时区与主机不同。需要设置设备级别的时区,以便 header 签名正确发送到 Azure API。
这解决了问题。
关于c# - Azure Blob 存储 - 服务器无法对请求进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46936817/