Queue Storage — Python SDK Quick Reference
Condensed from azure-storage-queue-py. Full patterns (async client, base64 encoding, queue properties, message updates) in the azure-storage-queue-py plugin skill if installed.
Install
pip install azure-storage-queue azure-identity
Quick Start
Auth:
DefaultAzureCredentialis for local development. See auth-best-practices.md for production patterns.
from azure.storage.queue import QueueClient
from azure.identity import DefaultAzureCredential
queue_client = QueueClient("https://<account>.queue.core.windows.net", "myqueue", DefaultAzureCredential())Best Practices
- Delete messages after processing to prevent reprocessing
- Set appropriate visibility timeout based on processing time
- Handle
dequeue_countfor poison message detection - Use async client for high-throughput scenarios
- Use
peek_messagesfor monitoring without affecting queue - Set
time_to_liveto prevent stale messages - Consider Service Bus for advanced features (sessions, topics)