Is there any way to delete subscriptions from Azure Service Bus Topic, through C# code? (I know how to delete it only through the Azure portal website)
CodePudding user response:
I found that it can be done with
var serviceBusConnectionString = "Endpoint=sb://sample.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=K34CMjptykdwvAT9t7Frz3DX8OlelvSOBWxZfW8oFZwPg=";
var managementClient = new ManagementClient(serviceBusConnectionString);
await managementClient.DeleteSubscriptionAsync("lorem", "ipsum");