Azure Queue Storage library for 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
If your code uses
azure_coretypes directly, addazure_coretoCargo.toml. If you only useazure_storage_queuere-exports, directazure_coredependency is optional.
Environment Variables
Authentication
Rust Azure SDK code must not use DefaultAzureCredential. The Rust identity crate does not provide that type.
Do not infer public SDK types from generated internal model names. Prefer the crate README/examples when checking queue client method signatures and message/result shapes.
Client Types
Core Workflow
Send a Message
Receive Messages
Delete a Message
After receiving a message, delete it using the message ID and pop receipt:
Peek Messages
Peek at messages without removing them from the queue:
RBAC Roles
For Entra ID auth, assign one of these roles to the identity:
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
- Run
cargo clippy -- -D warningswhen the prompt, eval, or CI expects lint-clean output - Future-proof
#[non_exhaustive]SDK models — end model-struct initializers (e.g.QueueMessage) with..Default::default()(add#[allow(clippy::needless_update)]) and use a_wildcard arm when matching SDK enums, so new service-added fields/variants don't break your build


