
Azure Queue Storage for Rust
FreeManage Azure Queue messages seamlessly in Rust.
Free · Opens the source repo
What Azure Queue Storage for Rust does
The Azure Queue Storage library for Rust provides developers with the tools to interact with Azure's Queue Storage service. This library allows you to send, receive, and manage queue messages efficiently. It is particularly useful for applications that require reliable message queuing, enabling asynchronous communication between different components of your system. With this library, you can create and manage queues, peek at messages, and perform operations such as sending and deleting messages, all while adhering to Azure's security protocols.
To get started, you will need to install the official azure_storage_queue crate along with its dependencies, including azure_identity for authentication and tokio for asynchronous operations. The library supports role-based access control (RBAC), ensuring that your applications can securely interact with Azure resources. You can authenticate using DeveloperToolsCredential for local development and switch to ManagedIdentityCredential for production environments, maintaining best security practices.
The library's API is straightforward, with dedicated client types such as QueueServiceClient for account-level operations and QueueClient for queue-specific tasks. This separation of concerns allows for organized code and clear functionality when working with Azure Queue Storage. Additionally, the library provides comprehensive examples for common operations like sending and receiving messages, which can help developers quickly integrate queue functionality into their applications.
In summary, this skill is essential for Rust developers looking to implement Azure Queue Storage in their applications, providing a robust and secure method for managing message queues.
When to use it
Use this skill when your Rust application needs to send, receive, or manage messages in Azure Queue Storage.
When not to use it
This skill may not be suitable if you're not using Rust or if you require features from unofficial libraries not supported by this skill.
What you can build with it
Sending Messages to a Queue
Use the skill to send messages to an Azure Queue from your Rust application, facilitating communication between services.
Receiving Messages for Processing
Integrate the skill to receive and process messages from an Azure Queue, allowing your application to handle tasks asynchronously.
Managing Queue Operations
Utilize the skill to manage queues, including creating, deleting, and peeking at messages, ensuring efficient message handling.
How to install Azure Queue Storage for Rust
View source1. Install with the skills CLI
npx skills add sickn33/agentic-awesome-skills/azure-storage-queue-rust --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by sickn33Azure Queue Storage library for Rust
When to Use
Use this skill when you need azure Queue Storage library for Rust. Send, receive, and manage queue messages. Triggers: "queue storage rust", "QueueClient rust", "send message rust", "receive messages rust", "QueueServiceClient rust", "queue rust".
Client library for Azure Queue Storage — send, receive, and manage queue messages.
Use this skill when:
- An app needs to send or receive messages from Azure Queue Storage in Rust
- You need to create or manage queues
- You need to peek, receive, or delete queue messages
- You need RBAC-based auth for queue operations
IMPORTANT: Only use the official
azure_storage_queuecrate published by the azure-sdk crates.io user. Do NOT use unofficial or community crates. Official crates use underscores in names and none have version 0.21.0.
Installation
cargo add azure_storage_queue azure_identity azure_core tokio
If your code uses
azure_coretypes directly, addazure_coretoCargo.toml. If you only useazure_storage_queuere-exports, directazure_coredependency is optional.
Environment Variables
AZURE_STORAGE_QUEUE_ENDPOINT=https://<account>.queue.core.windows.net/ # Required for all operations
Authentication
use azure_core::http::Url;
use azure_identity::DeveloperToolsCredential;
use azure_storage_queue::QueueServiceClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.
let credential = DeveloperToolsCredential::new(None)?;
let service_url = Url::parse("https://<storage_account_name>.queue.core.windows.net/")?;
let service_client = QueueServiceClient::new(service_url, Some(credential), None)?;
// Derive a queue client by name.
let queue_client = service_client.queue_client("<queue_name>")?;
Ok(())
}
Client Types
| Client | Purpose | Access |
|---|---|---|
QueueServiceClient | Account-level operations, list queues | QueueServiceClient::new() |
QueueClient | Queue operations, send/receive/delete | service_client.queue_client("<name>")? |
Core Workflow
Send a Message
use azure_core::http::Url;
use azure_identity::DeveloperToolsCredential;
use azure_storage_queue::{models::QueueMessage, QueueServiceClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let credential = DeveloperToolsCredential::new(None)?;
let service_url = Url::parse("https://<storage_account_name>.queue.core.windows.net/")?;
let service_client = QueueServiceClient::new(service_url, Some(credential), None)?;
let queue_client = service_client.queue_client("<queue_name>")?;
let message = QueueMessage {
message_text: Some("hello world".to_string()),
};
queue_client.send_message(message.try_into()?, None).await?;
Ok(())
}
Receive Messages
use azure_core::http::Url;
use azure_identity::DeveloperToolsCredential;
use azure_storage_queue::QueueServiceClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let credential = DeveloperToolsCredential::new(None)?;
let service_url = Url::parse("https://<storage_account_name>.queue.core.windows.net/")?;
let service_client = QueueServiceClient::new(service_url, Some(credential), None)?;
let queue_client = service_client.queue_client("<queue_name>")?;
let response = queue_client.receive_messages(None).await?;
let messages = response.into_model()?;
for msg in messages.items.unwrap_or_default() {
println!("{}", msg.message_text.as_deref().unwrap_or("<empty>"));
}
Ok(())
}
Delete a Message
After receiving a message, delete it using the message ID and pop receipt:
let response = queue_client.receive_messages(None).await?;
let messages = response.into_model()?;
for msg in messages.items.unwrap_or_default() {
if let (Some(id), Some(pop_receipt)) = (&msg.message_id, &msg.pop_receipt) {
queue_client.delete_message(id, pop_receipt, None).await?;
}
}
Peek Messages
Peek at messages without removing them from the queue:
let response = queue_client.peek_messages(None).await?;
let messages = response.into_model()?;
for msg in messages.items.unwrap_or_default() {
println!("Peeked: {}", msg.message_text.as_deref().unwrap_or("<empty>"));
}
RBAC Roles
For Entra ID auth, assign one of these roles to the identity:
| Role | Access |
|---|---|
Storage Queue Data Reader | Read and peek messages |
Storage Queue Data Contributor | Read/write messages |
Storage Queue Data Message Sender | Send messages only |
Storage Queue Data Message Processor | Receive and delete |
Best Practices
- Use
cargo addto manage dependencies, never editCargo.tomldirectly. Add and remove Rust SDK dependencies with cargo commands instead of manual manifest edits. - Add
azure_coreonly when importingazure_coretypes directly. If your code importsazure_core::http::Url,azure_core::http::RequestContent, orazure_core::error::ErrorKind, includeazure_core; otherwise a direct dependency is optional. - Use
DeveloperToolsCredentialfor local dev,ManagedIdentityCredentialfor production — Rust does not provide a singleDefaultAzureCredentialtype - Never hardcode credentials — use environment variables or managed identity
- Assign RBAC roles — ensure appropriate queue data roles for the identity
- Use
QueueServiceClientas the entry point and deriveQueueClientfrom it viaqueue_client() - Delete messages after processing — use the message ID and pop receipt from
receive_messages - Reuse clients — clients are thread-safe; create once, share across tasks
Reference Links
| Resource | Link |
|---|---|
| API Reference | https://docs.rs/crate/azure_storage_queue/latest |
| crates.io | https://crates.io/crates/azure_storage_queue |
| Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/storage/azure_storage_queue |
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Frequently asked questions about Azure Queue Storage for Rust
Similar skills
WinMD API Search
Easily find and explore Windows desktop APIs.
WebMCPify
Transform any web app into an agent-ready platform.
Phoenix Tracing
Instrument LLM applications with OpenInference tracing.
Foundry Hosted Agent CopilotKit
Guidance for developing agentic web apps on Azure.
Power Automate Foundation
Connect AI agents to Power Automate seamlessly.
Power Automate Flow Builder
Efficiently build and deploy Power Automate flows programmatically.
