AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/persistence/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Azure Storage Persistence Upgrade Version 4 to 5

Switching to Azure.Data.Tables

This version introduces support for Azure.Data.Tables and moves away from the deprecated Microsoft.Azure.Cosmos.Table package.

For an overview of the SDK changes, refer to the official Azure migration guide.

In brief though, instances of CloudTableClient need to be replaced with TableServiceClient and TableEntity needs to be replaced with ITableEntity when declaring saga entities. Any properties that should be excluded from storage, use the IgnoreDataMember-attribute instead of IgnoreProperty.

Passing an instance of the client

Instead of:

var persistence = endpointConfiguration.UsePersistence<AzureTablePersistence>();
var account = CloudStorageAccount.Parse(connection);
var cloudTableClient = account.CreateCloudTableClient();
persistence.UseCloudTableClient(cloudTableClient);

Use:

var persistence = endpointConfiguration.UsePersistence<AzureTablePersistence>();
var tableServiceClient = new TableServiceClient(connection);
persistence.UseTableServiceClient(tableServiceClient);

Configuring a client provider

Previously, a custom Cloud table client provider could be created by implementing IProvideCloudTableClient which is now replaced with IProvideTableServiceClient to reflect the new client type.

See the configuration section for additional guidance.

Compatibility mode

This package continues to be fully compatible with the NServiceBus.Persistence.AzureStorage version 1 and 2. It supports both sagas that use secondary index entries as well as sagas that don't have a secondary index entries. It's important to note that the compatibility mode does need to be manually enabled. It has been disabled by default in favor of performance.

To opt-in for the compatibility mode, use:

var persistence = endpointConfiguration.UsePersistence<AzureTablePersistence>();
var compatibility = persistence.Compatibility();
compatibility.EnableSecondaryKeyLookupForSagasCorrelatedByProperties();

Related Articles