Why is the queue domain on my azure storage account missing?
Asked Answered
E

1

5

I have successfully create a storage account on Azure with the following settings:

  • Deployment: Resource manager
  • Type: General Purpose (Standard)
  • Replication: ZRS

On the Azure portal I can see a "Blobs" service and if I click on it, I can create blob containers under the blob domain: https://[account_name].blob.core.windows.net/

So far so good.

When I try to create a queue using the Azure SDK in a C# app I get the error that it can't find the domain for [account_name].queue.core.windows.net .

I've been following the Microsoft tutorials for creating a storage account and getting a simple queue working and I can't see any other steps the create this "queue" domain. On the Azure portal itself, I can't find any other options to create a Queue or Queue service.

The code I'm using for reference:

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();

The call to create the blob container succeeds and I can see the new container in the Azure Portal. The call to create the queue fails with the following exception:

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'
Extravascular answered 2/6, 2016 at 17:48 Comment(2)
Please edit your question to show the code you used, for creating your queue (and the resulting error). Also: What's visualized on the portal has nothing to do with availability of your Storage account. The fact that you can manipulate blobs means your storage account exists.Mercorr
Thanks for the suggestion David. I added the code and exception.Extravascular
M
12

The reason you're getting this error is because ZRS storage accounts only support Blob Storage (and that too Block Blobs only). From this blog post: https://blogs.msdn.microsoft.com/windowsazurestorage/2014/08/01/introducing-zone-redundant-storage/ (see section Using a ZRS account)

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.

If you want to use queues, you need to choose another redundancy level. At this time following types of storage account redundancy levels support queues - LRS, GRS, and RAGRS. Currently it is not possible to change a ZRS account into LRS/GRS/RAGRS account. Thus you would need to create a new storage account.

Morgun answered 3/6, 2016 at 1:56 Comment(2)
Thank you for the infomartion Gaurav. I chose ZRS as it seemed like the most appropriate for my use case but had no idea of the queue restriction. I'll create a new account and give that a try.Extravascular
Also, when you create a new storage account please don't choose the account kind as Blob Storage as same restrictions will apply there :). Choose a Storage kind of storage account.Morgun

© 2022 - 2024 — McMap. All rights reserved.