Xardas
Xardas

Reputation: 1855

Blob upload unauthorized Server failed to authenticate the request exception

I used this code a week ago and everything was fine. My colleagues are still using the exact same code and they have no problem at all.

StorageCredentialsAccountAndKey heronStorage = new StorageCredentialsAccountAndKey("heron", "someKey");
CloudBlobClient blobClient = new CloudBlobClient("someUrl", heronStorage);
CloudBlobContainer container = blobClient.GetContainerReference("containerName");
container.CreateIfNotExist();
container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });

This code throws:"Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature." at container.CreateIfNotExist(); line.

I copied their code and it's still the same. I'm all out of ideas.

Upvotes: 0

Views: 1263

Answers (1)

Akash Kava
Akash Kava

Reputation: 39916

Make sure your system clock is properly synchronized, wrong time zone and improper synchronization causes hashes to fail. As servers use time as part of synchronization to validate requests.

Upvotes: 3

Related Questions