How to create queue in service bus in azure by application
Is it possible to create a queue on the azure service bus by the sdk?
Same as RabbitMQ
channel.QueueDeclare(queue: "" ....
Solution 1:
Have a look at the ServiceBusAdministrationClient
and its CreateQueueAsync
method.
Creates a new queue in the service namespace with the given name.
var administrationClient = new ServiceBusAdministrationClient("ServiceBusConnectionString");
await administrationClient.CreateQueueAsync(queueName);
Make sure the connection string has manage rights.
Updated to target the current generation of packages thanks to Jesse Squire's comment below 👇🏻