Search code examples
c#.netazureazureservicebusmasstransit

.NET - How correctly set Azure Service Bus queue/topics for function


I am creating a project in .NET and I have one api application and next to it 2 functions. I want to communicate between the application and the functions using the Service bus for this I am using MassTransit. My question is where do I create the necessary queues/topics. Because I assume that directly in functions is the problem also according to my research. I thought of creating it manually by configuring it in mass transit directly in the application, but somehow I can't do that. Manually in the portal is rather out of the question. And I'm already a bit at a dead end and don't know what to do. Thank you in advance for your advice


Solution

  • MassTransit isn't going to create subscription/queues for consumers that aren't running inside MassTransit. Azure Functions requires that any queues/subscriptions used by functions exist when the function is started.

    There are plenty of comments above that offer some suggestions on how to create them, using ARM or whatever else makes sense in your deployment.