I'm currently developing some stuff that requires me to upload blobs to the azure blob storage but I've been having some issue with the message signature. On most of my request it works and my table requests never fails (create table, update entity, insert
entity and delete entity). The issue start with azure returning the following error:
<?xml version="1.0" encoding="utf-8"?><Error><Code>InternalError</Code><Message>Server encountered an internal error. Please try again after some time.
I then reuse the old request to do a retry. The old message signature looked like this:
But then I get the following error message when retrying:
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Time:2012-04-15T21:58:52.3098953Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'YUo4shHIcNLnX3rVuNDsn3egE/YL2wGU6yWQ5YkC01Q=' is not the same as any computed signature. Server used following string to sign: 'PUT
Now the content length is set to 0 for some reason and it doesnt work anymore. I am aware of that the request only works for 15 min, but this retry happens a few seconds after the first try. I'm not getting this error when retyring the table requests (for
example if the table doesn't exist), it's just for the blob storage I get this.
This is what the function that creates the header looks like:
Have you watched the request/response in a tool like Fiddler? I assume based on the error that the second time, your request is being sent with a content-length header of zero. Double check your code that sends the retried request?
Do you use Azure emulator as the target storage or the real cloud storage?
One of the reason for this error can be that (UTC) time at your development machine is different than that on the Azure storage server. At the underlying level the REST mechanism is used for accessing the storage. This also includes encrypted header and
in order to counter for replay attacks Azure storage API fails because of date discrepancy.