Azure-sdk-for-go: Authentication for Service Bus (and others)

Created on 28 Apr 2018  路  8Comments  路  Source: Azure/azure-sdk-for-go

Sorry if this is a silly question, but it's unclear to me how to use connection strings with the Go SDK. For example I have a connection string for a servicebus. In theory I should just be able to use those creds to start using the servicebus.

Looking at https://docs.microsoft.com/en-us/go/azure/azure-sdk-go-authorization I can see various options (certs etc)... but nothing about using connection strings that the Azure portal provides.

Am I missing something?

Thanks

Ken

Service Bus

Most helpful comment

Hi folks, here's a link to the Golang Service Bus library as promised.

@kpfaulkner here's how we handle connection strings: https://github.com/Azure/azure-service-bus-go/blob/master/namespace.go#L71-L88

All 8 comments

Hi @kpfaulkner. Connection strings are typically for data plane operations while AAD auth is for ARM, can you describe what you're trying to do? Thanks!

cc @devigned

Hi

I'm purely wishing to use the servicebus (and not provision anything via ARM etc). As an example, I want to be able to connect to the servicebus, push some messages, get message counts etc. So purely a "using" rather than provisioning.

Thanks

Ken

Adding another note, I know .NET and javascript library supports creating service bus resources like queue, and topic with connection string from SAS: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-get-started-with-queues

However, it seems that AAD is the only option in the golang library. Can we make the library to support connection string as an alternative?

@kpfaulkner we are working on a Golang Service Bus library and should have a preview out soon. Here's some of the underpinnings we've worked on for Event Hub which also work for SB: https://github.com/Azure/azure-amqp-common-go/blob/master/sas/sas.go.

The https://github.com/Azure/azure-amqp-common-go packages provide much of the basics needed for accessing Service Bus and Event Hub.

Let me know if you have any questions. I'm happy to help out.

@devigned Thanks. Can't wait to see that.

Thanks @kpfaulkner, @cjhpaul and @devigned. As @devigned alluded to, connection strings and SAS tokens are used for data-plane authentication. That is, the Service Bus namespace is created through the management library in this repo, but interacting with queues and topics is through a data-plane package which will be at github.com/Azure/azure-service-bus-go.

The equivalent package for working with Event Hub queues is already available in preview at github.com/Azure/azure-event-hubs-go.

@kpfaulkner if you still have questions feel free to re-open or open a fresh issue, thanks!

Hi folks, here's a link to the Golang Service Bus library as promised.

@kpfaulkner here's how we handle connection strings: https://github.com/Azure/azure-service-bus-go/blob/master/namespace.go#L71-L88

awesome, cheers!

Was this page helpful?
0 / 5 - 0 ratings