Windows Azure - Create Queue In Storage Emulator

In this article, we are trying to create a Queue in the storage emulator. The same Queue creation can be done on storage accounts too.

Some Theories on Blob in Azure

Azure Storage Queues is essentially a queueing service built on Azure Storage. It's one of the fundamental storage features of Azure and we use it for essential email between applications. So, if you're familiar with Microsoft message gearing or MQSeries, service bus, then you already know Azure Storage Queues. Now bear in mind, Azure Storage Queues are a lot simpler, much more of a fundamental service than MSMQ, MQSeries, or even Service Bus. Those are very rich in their APIs, whereas storage queue is pretty straightforward. Now if you want to use storage queues, you have many different client libraries.

Following are the key concepts in a queue.

FIFO implementation

Messages are added to end of the Queue and processed from the front

Queues provide a good way of Front End and Back End decoupling

In a real-world example, the user can queue a job through the web role (front end) and the job can be processed by a worker role (backend). This gives an opportunity to decouple the web role and worker role.

Azure

Following are the steps involved in the creation of container and blob in local storage.

Step 1

Create new console project

Step 2

Add reference to library files

We need to add specific reference to the following Windows Azure SDK DLL file.

DLL: Microsoft.WindowsAzure.StorageClient.DLL

Go to Solution - Right Click -> Manage Nuget Package->Install Microsoft.WindowAzure.Storage

Azure

Step 3

Now open the code, the main method, and add code.

Azure

Ensure that the queue name is lower case (upper case will throw an exception).

The above code will create a new message in the queue. You can view the queue created in the View->Cloud Explorer.

Summary

In this article, we have seen how to put a message into Queue and later retrieve it. In the next article, I will explain other operations that can be performed in a queue.