Skip to main content
The Azure Storage Queue provider offers a cost-effective, reliable messaging solution for applications using the Azure ecosystem. It’s perfect for high-volume scenarios where message ordering is not critical.

Installation

Install the Azure Storage Queue packages:

Basic Configuration

Publishing Configuration

Configure the publisher in your startup:

Dispatching Configuration

Configure the message dispatcher:

Configuration Options

AzureStorageQueueOptions

Connection String Formats

Azure Storage supports multiple connection string formats:

Standard Connection String

Configure managed identity in your application:

Development Storage Emulator

For local development with Azurite:

Queue Naming Strategies

Default Queue Names

Use a default queue for all messages:

Custom Queue Name Resolver

Implement custom queue naming logic:

Environment-Based Naming

Include environment in queue names:

Message Handling Patterns

Simple Handler

Error Handling

Azure Functions Integration

Queue Trigger Function

Use Azure Functions with Storage Queue triggers:

Function Startup Configuration

Monitoring and Observability

Built-in Logging

SimpleMessageBus logs important events:

Custom Metrics

Track custom metrics:

Performance Optimization

Batch Processing

Process multiple messages efficiently:

Connection Pooling

Azure Storage client automatically pools connections, but you can optimize:

Security Best Practices

Use Azure Managed Identity instead of connection strings:

Least Privilege Access

Configure minimal required permissions:
  • Publisher: Storage Queue Data Message Sender
  • Dispatcher: Storage Queue Data Message Processor

Network Security

Use private endpoints and VNets:

Troubleshooting

Symptoms: StorageException with authentication errorsSolutions:
  • Verify connection string format
  • Check account name and key
  • Ensure storage account exists
  • Verify network connectivity
Symptoms: Slow message processing, high latencySolutions:
  • Increase MaxConcurrentMessages
  • Reduce PollingInterval
  • Increase BatchSize
  • Use multiple queue processors
Symptoms: RequestEntityTooLarge exceptionsSolutions:
  • Azure Storage Queue limit: 64 KB
  • Store large payloads in Blob Storage
  • Reference blobs in messages

Complete Example

Here’s a complete working example:

Next Steps

Message Design

Learn message design best practices

Error Handling

Implement robust error handling

Testing

Test your Azure Storage Queue integration

Performance

Optimize for high throughput