Azure Storage Queues Transport Upgrade Version 6 to 7

New Configuration API

In Versions 6 and below the Azure Storage Queues transport was configured using an XML configuration section called AzureStorageQueueTransportConfiguration. This section has been removed in favor of a more granular, code based configuration API.

The new configuration API is accessible through extension methods on the UseTransport<AzureStorageQueueTransport>() extension point in the endpoint configuration. See also Azure Storage Queues Configuration.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
// Configure the transport
transport.ConnectionString("The Connection String");

Continue reading from app.config

Add the following to the app.config:

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
    <add key="AzureStorageQueueConnection"
         value="The Connection String" />

Then read it from app.config and pass to the transport configuration:

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
var connection = ConfigurationManager.AppSettings["AzureStorageQueueConnection"];

Setting the configuration values via API

Setting the configuration values can now be done via API in the following way:

Can be set using corresponding extension methods like in an example:

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();


PurgeOnStartup setting now can be set on EndpointConfiguration using extension method.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues


DefaultQueuePerInstance setting was deprecated and currently for setting this behavior refer to the Data distribution article.

Default value changes

The default values of the following settings have been changed:

  • ConnectionString which had a default value of UseDevelopmentStorage=true, was removed and became obligatory.
  • BatchSize changed from 10 to 32.


In previous versions, the Azure Storage Queues Transport change the default SerializationDefinition to JsonSerializer.

In Version 6 of NServiceBus transports no longer have the ability to manipulate serialization. To preserve backward compatibility and ensure that message payloads are small, setting JSON serialization should now be done on the endpoint configuration level.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues

API Changes

In Version 7 the public API has been reduced. As a result, multiple classes that used to be public in Versions 6 and below were marked as obsolete with a comment:

This class served only internal purposes without providing any extensibility point and as such was removed from the public API. For more information, refer to the documentation.

If code exist that depends on classes that were obsoleted with the above message, and it is not clear how to update it, then contact support to get help in resolving that issue.

Related Articles

Last modified