Service Bus: want to manage topics and subscriptions via connection string
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:10
- Comments:11 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 theManagementClient
for the API reference and theServiceBusScope
class in the test suite for a usage example.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])); } } }