Create an Azure Storage Queue
This tutorial guides you through the process of creating a new Azure Storage Queue using the Azure portal and Azure CLI. Queues are a robust messaging solution for reliable communication between application components.
Prerequisites
- An Azure account. If you don't have one, create a free account today.
- An Azure Storage account. If you don't have one, follow the steps to create a storage account.
Method 1: Using the Azure Portal
The Azure portal provides a user-friendly graphical interface to manage your Azure resources.
Sign in to the Azure portal
Navigate to https://portal.azure.com/ and sign in with your Azure account credentials.
Navigate to your Storage Account
In the Azure portal, search for and select "Storage accounts". Then, select the storage account where you want to create the queue.
Access the Queues Service
Under the "Data storage" section in your storage account's menu, select "Queues".
Create a Queue
Click the "+ Queue" button. A panel will appear on the right.
Enter a name for your queue in the "Name" field. Queue names must be lowercase, start with a letter, and can only contain letters and numbers. The maximum length is 63 characters.
Click "OK" to create the queue.
Your new queue will now appear in the list of queues for your storage account.
Method 2: Using Azure CLI
The Azure Command-Line Interface (CLI) is a powerful tool for managing Azure resources from your terminal.
Install Azure CLI
If you haven't already, install the Azure CLI by following the instructions for your operating system: Install the Azure CLI.
Log in to Azure
Open your terminal or command prompt and run:
az login
Follow the prompts to authenticate your account.
Set Your Subscription (if necessary)
If you have multiple Azure subscriptions, set the one you want to use:
az account set --subscription ""
Create the Queue
Use the following command to create a queue. Replace <your-storage-account-name> and <your-queue-name> with your actual values.
az storage queue create \
--name <your-queue-name> \
--account-name <your-storage-account-name>
Example:
az storage queue create \
--name myappqueue \
--account-name mystorageaccount123
The CLI will provide output indicating the success or failure of the operation.
Next Steps
Now that you have created an Azure Storage Queue, you can start adding messages to it. Explore the following topics:
- Add a message to an Azure Storage Queue
- Process messages from an Azure Storage Queue
- Azure Queues Overview