question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Service Bus: want to manage topics and subscriptions via connection string

See original GitHub issue

I’m trying to use Azure Service Bus pub/sub from .NET Core, by upgrading my net451 wrapper library to netstandard13/16.

On guidance from https://github.com/azure/azure-service-bus-dotnet, I’m looking at Microsoft.Azure.Management.ServiceBus.

Previously, I could do this:

      NamespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString);

      // then...
      if (!NamespaceManager.TopicExists(name))
      {
          if (createIfNecessary)
          {
              NamespaceManager.CreateTopic(name);
          }
      }

Now, it looks like I have Microsoft.Azure.Management.ServiceBus.ServiceBusManagementClient.Topics.Get, which immediately wants a resource group.

All I have is a connection string with Endpoint, SharedAccessKeyName and SharedAccessKey.

Is there a .NET Core equivalent for what I’m trying here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jsquirecommented, May 1, 2019

Hi @kierenj:

As @SeanFeldman mentioned, this is possible in the current version of the Service Bus client library, which has a embedded management surface in the Microsoft.Azure.ServiceBus.Management namespace. For starting off, you may want to have a look at the ManagementClient for the API reference and the ServiceBusScope class in the test suite for a usage example.

2reactions
jazeem-azeezcommented, Sep 13, 2018

just found this … while searching https://stackoverflow.com/questions/49421196/programatically-create-service-bus-subscription-using-net-standard

private async Task CreateTopicSubscriptions() { var client = new ManagementClient(ServiceBusConnectionString); for (int i = 0; i < Subscriptions.Length; i++) { if (!await client.SubscriptionExistsAsync(TopicName, Subscriptions[i])) { await client.CreateSubscriptionAsync(new SubscriptionDescription(TopicName, Subscriptions[i])); } } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with Azure Service Bus topics (.NET)
This quickstart shows how to send messages to a Service Bus topic and receive messages from a subscription to that topic by using...
Read more >
Use the Azure portal to create Service Bus topics and ...
On the Service Bus Topic page, select Subscriptions from the left menu, and then select + Subscription on the toolbar. Screenshot of the ......
Read more >
Azure Service Bus Topic And Subscription (Pub-Sub)
This articles explains about Azure Service Bus Topic and Subscription which ... Create topic client using connection string and queue name ...
Read more >
Azure Service Bus and its Complete Overview
Azure Service Bus supports grouping operations against a single messaging entity (queue, topic, subscription) within the scope of a transaction. Filtering and ...
Read more >
service-bus-dotnet-how-to-use-topics-subscriptions.md
Configure the application to use Service Bus · Get the Service Bus NuGet package · Set up a Service Bus connection string ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found