1
votes

i am getting following exceptions while uploading data to cloud(Azure). can anyone please help regarding the same?

com.microsoft.windowsazure.services.core.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization he ader is formed correctly including the signature.

Please Note : i am using APIs provided by Azure to access it. i am using the same code mentioned in following link by Azure Using Blob Storage

1
Could you please share out more details such as the blob name, how you are creating the SAS, or a sample code that reproduces the issue? Is it exactly the same as in the MSDN article or did you have any changes?Serdar Ozler
no that is the same as it is given there i am just passing my account name and account key. the problem i am facing is when i try uploading image first 2 to 3 images gets uploaded successfully and then shuddenly for 4th it fails...!(just an example, there is no exact pattern of failure, sometimes it fails in very first attempt also) giving the exception i mentioned :(dev2d

1 Answers

1
votes

as we are uploading, i wondered why we need SAS?? i just removed SAS from my upload finction URI and tried uploading, its not failing, no matter how frequent requests you make.

 URI uri = new URI(blobClient.getEndpoint().toString() + "/" +
                      containerName + "/" + 
                      blobName + 
                      "?" + 
                      containerSAS);

Remove containerSAS so final URI would be as following..

 URI uri = new URI(blobClient.getEndpoint().toString() + "/" +
                      containerName + "/" + 
                      blobName);

it worked...! :)