How do I access the AZ Service Bus without a SAS Key

823 views Asked by At

I need help in creating access to AZ a service bus without using thr Shared Access Key in an Azure Function. When I use the Endpoint, SharedAccessKeyName, SharedAccessKey, QueueName and RuleName it works great! I can create the connection string like this:

string connectionString = string.Format("Endpoint={0};SharedAccessKeyName={1};SharedAccessKey={2}", Endpoint, SharedAccessKeyName, SharedAccessKey);

Manager = new Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient(connectionString);

I was told that I can use the AZ Identity to accomplish this same thing without the SAS Key. I have not been able to figure out how to do this. In fact, I do not even know where to begin.

1

There are 1 answers

0
Anand Sowmithiran On

You can make your app to run under a managed Identity, and then configure your Azure Service Bus resource to allow access for that identity. See the documentation and the sample code here.