0

I'm having some problemas while using the WindowsAzure.Storage API to access the blob storage and get/set the CORS properties. My code is simple, something like:

Uri uri = new Uri("https://eqspprdimgstorage.blob.core.windows.net");
StorageCredentials sc = new StorageCredentials("myaccountname", "myverylongstring");
CloudBlobClient cbc = new CloudBlobClient(uri, sc);
cbc.GetServiceProperties();

While running this from a console app, I get this exception:

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

Looking at Fiddler, it gives more detail:

The MAC signature found in the HTTP request '(sharedkeyhere)' is not the same as any computed signature.
Server used following string to sign: 'GET











x-ms-client-request-id:67535105-1492-48c8-97b3-e82b891e3ba7
x-ms-date:Thu, 14 May 2015 23:19:35 GMT
x-ms-version:2014-02-14
/eqspprdimgstorage/
comp:properties
restype:service
timeout:90'.

Note that the empty lines are in the returned message. Also, I am not using any kind of proxy, and I'm not using REST but the .Net API. The request headers are:

GET https://eqspprdimgstorage.blob.core.windows.net/?comp=properties&restype=service&timeout=90 HTTP/1.1
User-Agent: WA-Storage/4.3.0 (.NET CLR 4.0.30319.34209; Win32NT 6.2.9200.0)
x-ms-version: 2014-02-14
x-ms-client-request-id: 67535105-1492-48c8-97b3-e82b891e3ba7
x-ms-date: Thu, 14 May 2015 23:19:35 GMT
Authorization: SharedKey eqspprdimgstorage:(sharedkeyhere)
Host: eqspprdimgstorage.blob.core.windows.net
Connection: Keep-Alive

Finally, some other notes: - I've used exacly the same account data in CloudBerry Explorer for Azure Blob Storage and I can see the values of the properties.

Any ideas? I'm also kind of stumped and frustrated at the lack of information on this topic (had a very similar experience while writing to sb queues using Mono/RaspberryPi2 and the REST api, unfortunatelly).

  • I tried the same code and it worked perfectly fine for me. Please check for two things: 1) Account key is correct and 2) Clock on your computer is correct. These are the two most common reasons for the error you're getting. – Gaurav Mantri May 15 '15 at 05:31
  • Hello Gaurav. I've tried those same credentials using the CloudBerry and I can access the blob storage with no problems (including adding images, for example). As to the clock: I'm, on Windows 8.1, in the correct timezone (Lisbon), and my time is internet synced with time.windows.com. Any other ideas? have you tried with the 4.3 version of the API? – João Pedro 'jota' Martins May 15 '15 at 09:50
  • That's totally weird. Yes, I used 4.3 version. Have you tried creating an instance of CloudBlobClient using something like: `var account = new CloudStorageAccount(sc, true); var cbc = account.CreateCloudBlobClient();`? – Gaurav Mantri May 15 '15 at 10:00

0 Answers0