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.
I've seen other samples on the net (such as this: http://blog.codingoutloud.com/2014/02/21/stupid-azure-trick-6-a-cors-toggler-command-line-tool-for-windows-azure-blobs/) which also don't seem to work.
the blob's contents are accessible publicly in the browser: http://eqspprdimgstorage.blob.core.windows.net/imgs/card%20images/icone-novo-635664320392396931.png
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).