Azure Storage Queues Sanitization

Component: Azure Storage Queues Transport
NuGet Package NServiceBus.Azure.Transports.WindowsAzureStorageQueues (8-pre)
Target NServiceBus Version: 7.x
This page targets a pre-release version and is subject to change prior to the final release.

In Versions 8.0 and above, the Azure Storage Queues transport no longer sanitizes queues by default.

Azure Storage Queues naming rules

  1. A queue name must start with a letter or number, and can only contain letters, numbers, and the dash (-) character.
  2. The first and last letters in the queue name must be alphanumeric.
  3. The dash (-) character cannot be the first or last character.
  4. Consecutive dash characters are not permitted in the queue name.
  5. All letters in a queue name must be lowercase.
  6. A queue name must be from 3 through 63 characters long.

Custom sanitization

To sanitize queue names, a sanitization function containing the required logic can be registered.

var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
transport.SanitizeQueueNamesWith(queueName => queueName.Replace(".", "-"));

When an endpoint is started, the sanitizer function will be invoked for each queue the transport creates.

Backwards compatibility

To obtain sanitizing logic backwards compatible with the transport versions below 8.0, refer to the Azure Storage Queues sample.


Related Articles

Last modified