1
votes

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.

enter image description here

  • 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

1
Please check for 2 things: 1) Storage account key used is correct. 2) Time on your local machine is correct. In my experience these are the two reasons you would get the error you're getting.Gaurav Mantri
Are you accessing the storage using a shared access token (SAS)?aaronR
@GauravMantri the storage account was copied directly from Azure Portal and the time and the timezone are set automatically. It's a fresh new account. My timezone is UTC +8:00 and the selected region for the Storage is Southeast Asia, East Asia.David Freire
@aaronR using storage account and keyDavid Freire
David...When you get the error in your code, can you check the RequestInformation property of the StorageException you get? Normally you will find more details about this error (please look inside ExtendedErrorInformation in there). Please update your question with those details. Thanks.Gaurav Mantri

1 Answers

1
votes

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.