I'm developping a Java app for Azure. I've currently no Azure account so I'm just developping my app on my laptop. I don't plan to subscribe until my testcase app works in local.
I can connect to my local SQL server. But the table/blob storage doesn't work. I used the java code provided in the documentation. I added the required jar for connecting to storage service. The java code compiles, no problem. But when running the code,
the console returns :
Infos: StorageException encountered:
Infos: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
I'm using the default auth parameters (devstoreaccount1 and the very long password Eby8vd.......GMGw==
The storage emulator is running..... I can browse the storage (by using the PHP azure plugin for eclipse)...
Does anybody have any idea ? Does the code must run from inside the compute emulator ? Because for convenience, I run my code on a glassfish server which is not running inside the compute emulator.
It seems that a problem is connected with your connection string.
I received this problem some months ago and killed a day for resolving it. My problem was connected with wrong time on developer machine so when i send a request it was too old for server and was titled as stale (i don't know exactly, what words i can use
for this situation, so sorry for my terminology).
But google helped me with such a suggestions:
1) Disable proxy.
2) Check a certificate.
3) Generate a shared secret signature for your blobs and properly set it up (advice from Steve Marx from somewhere in the forum, as a best practice for blob using).
But it is local development environment so i think problem does not connected with proxy or cert.
Maybe you can provide some additional info about request and response? It would be great.
First of all, thanks you both of you for your answers.
Alexander, I've run wireshark and noticed that indeed, the request looks weird with the time
I'm french, configured my laptop in GMT+1 with daylight saving time and I've run the request at 16:46:22. The header "x-ms-date" indicates 15:46:22, so the header is 1 hour too old......the initial HTTP PUT request indicates a timeout of 90....... I guess I
must hit the timeout, as you said....
The response packet contains this :
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\x0aRequestId:3160ab68-79ea-4325-ae58-708582a7f9c1\x0aTime:2012-02-22T15:46:18.8446499Z
The MAC signature found in the HTTP request '/V9ufqkos7fQsPFrG9db1c/ZSRTFQeOCH9R6d660GhM=' is not the same as any computed signature. Server used following string to sign: 'PUT\x0a\x0a\x0a0\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0ax-ms-date:Wed, 22 Feb 2012 15:46:22
Yes actually, I'm configured with UTC, not GMT, sorry for the mistake.
I've run another test. I've set my laptop at UTC+0, I've run the query again and the date is exactly the same as it should be, it's correct. It seems it's finally not related to the date.
I've the very same message as before :
The MAC signature found in the HTTP request 'DABdM6/BdW6qSWVm7ONQgY80t8j/XD5Z7cKpzEwHVqY=' is not the same as any computed signature. Server used following string to sign: 'PUT\x0a\x0a\x0a0\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0ax-ms-date:Wed, 22 Feb 2012 16:21:22
A few options here, I believe the reason you are having issues is that you are using the devstore credentials without providing endpoints for the local storage. This can be done manually, or you can make use of CloudStorageAccount.getDevelopmentStorageAccount();
and create your service clients from there.