Azure Queue Storage is an asynchronous messaging system in the cloud which enables you to pass messages from one application to another. This is great for loosely coupled architectures which have independent application tiers, where you will have the ability to scale independently within those application tiers. A single queue message can be up to 64 KB in size, and a queue can contain millions of messages, up to the total capacity limit of a storage account.
When you create a storage account, it includes the Queue service alongside the Blob and Table services. Table services can be accessed through a URL format. It looks like this:
http://<storage account name>.queue.core.windows.net/<queue name>.
Common uses of Queue storage include,
- Creating a backlog of work to process asynchronously
- Passing messages from an Azure web role to an Azure worker role
Here, in this article, first, we will create a storage account and have the keys to use it in our application and then a console application, which connects to the storage account and create a queue inside it.
Step 1
Log in to your Microsoft Azure portal, click on Create new resource and select Storage account - blob, file, table, the queue from Storage category to create a Storage account and give the necessary details as follows.
- Name: A Unique Name
- Deployment: Resource manager
- Account kind: General purpose (Can’t work with Files, Tables or Queues in case of Blob Storage)
- Location: Nearest to you
- Replication: Read-access geo-redundant storage
- Locally-redundant storage- Three copies within the same data center
- Zone-redundant storage- Three copies within two data centers of the same region
- Geo-redundant storage- Three copies in a primary data center and three copies in another data center
- Performance: Standard (For premium only LRS replication is available as of now)
- Secure Transfer Required: Disabled
- Resource group: Create a new as QueueStorageRG
Step 2
Once the deployment has succeeded, open the resource and click on Access keys and note a key for a later purpose.
Step 3
Create a new C# Console Application within Visual Studio and name it QueueDemo.
Step 4
Once the project is created, install two NuGet Packages named WindowsAzure.Storage and WindowsAzure.ConfigurationManager to your solution. You can do this by selecting Tools > NuGet Package Manager > Manage NuGet Packages for Solution. In the Browse tab, search for WindowsAzure.Storage and WindowsAzure.ConfigurationManager to get the packages. Complete the installation by reviewing the changes and accepting the license term for both.





Join the conversation! Your thoughts help the community grow.