I'm migrating a WebJobs project from .NET 4.6 to .NET 7 and I came across a quite significant problem - my new project does not seem to create missing topics and queues in the ServiceBus namespace. I can't find a way to force it to do so either.
I found AccessRights argument in ServiceBusTriggerAttribute but that's not exposed by Microsoft.Azure.WebJobs.Extensions.ServiceBus.
I also tried tweaking configuration in AddServiceBus(this IWebJobsBuilder builder, Action<ServiceBusOptions> configure) but it doesn't seem to expose anything relevant to provisioning these topics/queues.
Am I missing something here or is there no way to automate it and I'll need to provision them myself?
P.S. I'm authenticating using a shared access key with "manage" permissions (just FYI)
#EDIT
I also found this issue raised against the WebJobs SDK. Unfortunately there's no explanation of any recommended approach in place of the AccessRights option - https://github.com/Azure/azure-webjobs-sdk/issues/1509
In the newer versions of the
Microsoft.Azure.WebJobs.Extensions.ServiceBuspackage, there is no built-in capability to automatically create missing Service Bus topics and queues. You need to provision them manually.And I couldn't find any information on how to force the creation of missing topics and queues in the ServiceBus namespace in .NET 7 WebJobs project.
Code reference taken from Github code.
.CSProjfileCreated Service Bus topic or queue in azure.
If the Service bus topic or queue already exists
For further information, refer to the MSDoc1.