【发布时间】:2016-06-03 11:02:13
【问题描述】:
我已使用以下设置在 Azure 上成功创建存储帐户:
- 部署:资源管理器
- 类型:通用(标准)
- 复制:ZRS
在 Azure 门户上,我可以看到一个“Blobs”服务,如果我点击它,我可以在 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'
【问题讨论】:
-
请编辑您的问题以显示您用于创建队列的代码(以及由此产生的错误)。另外:门户上显示的内容与您的存储帐户的可用性无关。您可以操作 Blob 的事实意味着您的存储帐户存在。
-
感谢大卫的建议。我添加了代码和异常。
标签: c# azure azure-storage-queues