Server Version: 2018-11-09
Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. 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.
Source code | Package (NuGet) | API reference documentation | Product documentation
Install the Azure Storage Queues client library for .NET with NuGet:
Install-Package Azure.Storage.Queues
Prerequisites: You must have an Azure subscription, and a Storage Account to use this package.
To create a Storage Account, you can use the Azure Portal, Azure PowerShell or Azure CLI:
Common uses of Queue storage include:
- Creating a backlog of work to process asynchronously
- Passing messages between different parts of a distributed application
string connectionString = <connection_string>;
var service = new QueueServiceClient(connectionString);
var queue = service.GetQueueClient("myqueue");
await queue.CreateAsync();
string connectionString = <connection_string>;
var service = new QueueServiceClient(connectionString);
var queue = service.GetQueueClient("myqueue");
var messages = queue.GetMessagesClient();
await messages.EnqueueAsync("Start using Azure");
await messages.EnqueueAsync("Get started with Queues");
string connectionString = <connection_string>;
var service = new QueueServiceClient(connectionString);
var queue = service.GetQueueClient("myqueue");
var messages = queue.GetMessagesClient();
response = await messages.DequeueAsync();
foreach (var message in response.Value)
{
Console.WriteLine(message.MessageText);
}
All Azure Storage Queue service operations will throw a
StorageRequestFailedException on failure with
helpful ErrorCode
s.
Get started with our Queue samples.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.