Automatically provision NServiceBus Service Bus Function endpoint topology

2021-01-19 update: code for subscription was adjusted to ensure the correct default rule for subscription is created.
In the previous post, Automatically create Service Bus trigger queue for Azure Function, I’ve shown how to provision a ServiceBusTrigger queue from within a Function.
In this post, we’ll take that idea and push it further to something a bit more sophisticated - provisioning the topology necessary for NServiceBus endpoint hosted with Azure Function and using Azure Service Bus transport. If you haven’t used NServiceBus or NServiceBus with Azure Functions, here’s a starting point for you. NServiceBus can bring a few advantages over native Functions I’ll leave to discover on your own. And now, let’s have a look at what are the things we’ll need to accomplish.








