Introduction
In this article, you will learn about queues in Microsoft Azure and how to manage queues using Powershell.
In the world of computers and data structures, the queue is a collection of entities. This collection is maintained in a sequence, this sequence can be modified by adding entities on one end and removing them from the other. The sequence where the elements are added is called back, tail, or rear of the queue. Head or front of the queue is called to the point from where elements are removed.
What is Queue in a layman’s language?
From a perspective of a developer, the queue is basically a data structure used to store data in a manner that follows the First-in First-out rule. Data can be added to the tail while it is deleted from the front. The process of adding to the rear is called enqueue, and removing from the front is called dequeue.
Queue And Microsoft Azure
Azure queues use a similar concept to store messages in a queue. The process followed by Azure in message queue service is,
- Firstly, a sender sends the message which is received by the client and processes them. This message might have some attributes attached to it.
- Once the client has processed the message it deletes it. What Azure does is its service store the message for 7 days and deletes it automatically after it if it is not done by the client.
Sometimes, there is one sender and one client or one sender and many clients. Many senders and many clients are also one of the scenarios.
Decoupling the segments is one of the benefits of message queue services. It runs in an offbeat climate where messages can be sent among the various parts of an application. In this manner, it gives a productive answer for overseeing work processes and undertakings. For instance, a message to finish an undertaking is sent from the frontend of the application and is gotten by a backend laborer, who at that point finishes the assignment and erases the message.
Note
The Message does not duplicate anywhere. This means that there only one copy of your message. The maximum number of messages is 20,000 whereas the size limit is 64kb.
How to Create a Queue Using Azure Portal
To create a queue, you must have a resource group and storage account. I have already written an article on how to create a storage account.
Below are some simple steps that you need to follow to create a queue.
- Login on Portal.azure.com

- Click on the storage account to open it. You can directly click on your storage account from 'recent resources'.

- Scroll down to go 'Queue services' and click on Queues'. To create a new queue, click on '+Queue' at the top.

- After click on '+Queue', a new window will be open for 'Add Queue'. Write the name of the queue in the text box and click on 'Ok'.

Your queue has now been created.
You can see it in azure storage explorer. that I have shown at the end of the article.
How to Manage Queues using PowerShell?
Create a Queue
Step 1
Right-click on Windows PowerShell in the taskbar. Choose ‘Run ISE as administrator’.

Step 2
Run the following command to access your account. Please replace the highlighted part for your account.
- $context = New-AzureStorageContext -StorageAccountName csharpcorner StorageAccountKey ****************
Step 3
Specify the storage account in which you want to create a queue.
- Set-AzureSubscription –SubscriptionName "Free Trial" -CurrentStorageAccount csharpcorner


Join the conversation! Your thoughts help the community grow.