Home > Mobile >  Deleting subscriptions from Azure Service Bus Topic through C#
Deleting subscriptions from Azure Service Bus Topic through C#

Time:08-08

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 enter image description here

var serviceBusConnectionString = "Endpoint=sb://sample.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=K34CMjptykdwvAT9t7Frz3DX8OlelvSOBWxZfW8oFZwPg=";
var managementClient = new ManagementClient(serviceBusConnectionString);
await managementClient.DeleteSubscriptionAsync("lorem", "ipsum");

NuGet: Azure Service Bus client library for .NET

  • Related