以下代码在“CreateIfNotExist”方法调用中引发错误。我正在尝试连接到我的 Azure Blob 存储并创建一个名为“图像”的新容器
var storageAccount = new CloudStorageAccount(
new StorageCredentialsAccountAndKey("my_account_name", "my shared key"),
"https://blob.core.windows.net/",
"https://queue.core.windows.net/",
"https://table.core.windows.net/"
);
var blobClient = storageAccount.CreateCloudBlobClient();
var blobContainer = blobClient.GetContainerReference("images");
blobContainer.CreateIfNotExist();
错误是:
[StorageClientException: The requested URI does not represent any resource on the server.]
“图像”容器不存在,但我希望创建它而不是抛出错误。我究竟做错了什么?
我尝试过 HTTP 而不是 HTTPS,但结果是相同的错误。