gpt4 book ai didi

c# - 为什么我的 Azure 存储帐户上的队列域丢失?

转载 作者:太空狗 更新时间:2023-10-29 21:01:12 25 4
gpt4 key购买 nike

我已使用以下设置在 Azure 上成功创建存储帐户:

  • 部署:资源管理器
  • 类型:通用(标准)
  • 复制:ZRS

在 Azure 门户上,我可以看到“Blob”服务,如果单击它,我可以在 blob 域下创建 blob 容器:https://[account_name].blob.core.windows.net/

到目前为止一切顺利。

当我尝试在 C# 应用程序中使用 Azure SDK 创建队列时,收到错误消息:找不到 [account_name].queue.core.windows.net 的域。

我一直在遵循 Microsoft 教程来创建存储帐户并让简单的队列正常工作,但我看不到创建此“队列”域的任何其他步骤。在 Azure 门户本身上,我找不到任何其他选项来创建队列或队列服务。

我用来引用的代码:

var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureWebJobsStorage"].ToString());

var blobClient = storageAccount.CreateCloudBlobClient();
var blobContainer = blobClient.GetContainerReference("export");
blobContainer.CreateIfNotExists();

var queueClient = storageAccount.CreateCloudQueueClient();
var exportQueue = queueClient.GetQueueReference("export-requests");
exportQueue.CreateIfNotExists();

创建 blob 容器的调用成功,我可以在 Azure 门户中看到新容器。创建队列的调用失败,出现以下异常:

An exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll but was not handled in user code

Additional information: The remote name could not be resolved: '[account_name].queue.core.windows.net'

最佳答案

您收到此错误的原因是 ZRS 存储帐户仅支持 Blob 存储(并且也仅支持 block Blob)。来自这篇博文:https://blogs.msdn.microsoft.com/windowsazurestorage/2014/08/01/introducing-zone-redundant-storage/ (请参阅使用 ZRS 帐户部分)

Since ZRS accounts do not support page blob, file, table or queue, any attempt to create or manipulate those objects on a ZRS storage account will fail.

如果要使用队列,则需要选择另一个冗余级别。目前,以下类型的存储帐户冗余级别支持队列 - LRS、GRS 和 RAGRS。目前无法将 ZRS 帐户更改为 LRS/GRS/RAGRS 帐户。因此,您需要创建一个新的存储帐户。

关于c# - 为什么我的 Azure 存储帐户上的队列域丢失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37598851/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com