简体   繁体   中英

Azure Blob Storage - Server failed to authenticate the request

Getting the following error:

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

I'm using WindowsAzure.Storage package to get the blob stream, very simple.

 _blobClient = CloudStorageAccount
                .Parse(options.ConnectionString)
                .CreateCloudBlobClient();

  var blob = _blobClient.GetContainerReference(containerName)
                .GetBlobReference(blobName);

var file = await blob.OpenReadAsync(null, _requestOptions,
_context).ConfigureAwait(false);

I've tried using the Account Key and Name and the Connection String and the result is the same.

Same happens using Azure Storage Explorer , i cannot upload any file to the Storage. ( just keeps uploading with 0% progress ). Only works if i connect directly with my Microsoft Account.

在此处输入图片说明

  • My computer time and timezone are set automatically.
  • The region for the storage is Southeast Asia, East Asia

Is there any extra configuration that needs to be done?

Thank you

I was running the code in an Android emulator where the timezone is different from the host. Timezone needs to be set device level so that the header signature is sent correctly to the Azure API.

This solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM