我已使用以下设置在 Azure 上成功创建了一个存储帐户:
- 部署:资源管理器
- 类型:通用(标准)
- 复制:ZRS
在 Azure 门户上,我可以看到“Blobs”服务,如果单击它,我可以在 blob 域下创建 blob 容器:https://[account_name].blob.core.windows.net/
到目前为止,一切都很好。
当我尝试在 C# 应用程序中使用 Azure SDK 创建队列时,我收到错误消息,即找不到 [account_name] 的域。排队.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'