问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/15874847/blob-upload-unauthorized-server-failed-to-authenticate-the-request-exception