Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Azure Functions (Isolated Worker) Upgrade Version 5 to 6

Component: NServiceBus.AzureFunctions.Worker.ServiceBus
This page targets a pre-release version. Pre-releases are subject to change and samples are not guaranteed to be fully functional.

Default topology has changed

This version of the functions integration with Azure Service Bus uses NServiceBus.Transport.AzureServiceBus version 5 and higher. By default Azure Service Bus is configured to the default topology (using topic-per-event approach). The defaults can be overridden by adding topology options to the Application configuration

The functions integration looks for either topology options placed into AzureServiceBus:TopologyOptions or AzureServiceBus:MigrationTopologyOptions for migration and backward compatibility scenarios.

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureAppConfiguration(builder => builder.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true))
    .UseNServiceBus()
    .Build();

Using the default topology

{
  "AzureServiceBus": {
    "TopologyOptions": {
      "PublishedEventToTopicsMap": {
        "MyNamespace.SomeEvent": "some-event"
      },
      "SubscribedEventToTopicsMap": {
        "MyNamespace.SomeEvent": [
          "some-event",
          "some-other-event"
        ]
      },
      "QueueNameToSubscriptionNameMap": {
        "Publisher": "PublisherSubscriptionName"
      }
    }
  }
}

Using the migration topology

{
  "AzureServiceBus": {
    "MigrationTopologyOptions": {
      "TopicToPublishTo": "TopicToPublishTo",
      "TopicToSubscribeOn": "TopicToSubscribeOn",
      "EventsToMigrateMap": [
        "MyNamespace.NotYetMigratedEvent"
      ],
      "SubscribedEventToRuleNameMap": {
        "MyNamespace.NotYetMigratedEvent": "EventRuleName"
      },
      "PublishedEventToTopicsMap": {
        "MyNamespace.MigratedEvent": "MigratedEvent"
      },
      "SubscribedEventToTopicsMap": {
        "MyNamespace.MigratedEvent": "MigratedEvent"
      },
      "QueueNameToSubscriptionNameMap": {
        "Publisher": "PublisherSubscriptionName"
      }
    }
  }
}