Microsoft Azure cloud platform is gaining popularity in leaps and bounds. I was one of the fortunate people to try my hands early on this platform. Although, the coding is a breeze with Microsoft Azure there are sometimes some silly errors that will make your head go crazy thinking about it. There are some issues with development environment vs cloud environment too that make you wonder if there is something wrong on your end or is it the Azure itself causing bugs. The error that I got was "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.". It took me a lot of time to figure it out. This post is dedicated to that problem.
Azure Server failed to authenticate the request solution
If you are stuck with this problem the first thing to check is your system time. What happened in my case was that my PC got restarted and the local time (PC time) for some odd reason was set to west coast's time zone. I am, however, on the east coast. Due to this the timing that was sent with my REST API requests were too old. Due to this the cloud server will assume that the request was too old and hence expired. Thus, whenever I tried to connect to my blob storage account I got this message back:
The remote server returned an error: (403) Forbidden.
Request URI: https://gpcoverlay.blob.core.windows.net/?restype=container&comp=list&$maxresults=1
Date: Mon, 23 May 2011 22:15:31 GMT
Message: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
AuthenticationErrorDetail: Request date header too old: 'Mon, 23 May 2011 19:15:30 GMT'
Error Code: HTTP Status Code: (403)
After a careful observation I figured that the error details mentioned timing. I had to check everything else before I could zero down on true problem. You, on the other hand, know better now and I hope it will help someone somewhere to get rid of this issue. There is a great book on Microsoft Azure if you are interested -Programming Windows Azure: Programming the Microsoft Cloud - available on Amazon for about 30 bucks.