我一周前使用了这段代码,一切都很好。我的同事仍在使用完全相同的代码,他们完全没有问题。
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 });
此代码抛出:"Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature."
在行container.CreateIfNotExist();
。
我复制了他们的代码,它仍然是一样的。我完全没主意了。