0

I am creating an instance of ServiceBusClient to create MessageReceiver object. The MessageReceiver gives access to PeekMessageAsync method to peek into the DLQ messages and read the reason and error description.

I want to use the ManagedIdentity to authenticate the azure function. I am not able to authenticate the ServiceBusClient using ManagedIdentity.

1 Answers1

0

There are a few steps required to set up managed identity authentication for accessing Service Bus as outlined in this official doc. At a high level, here are what you need to do

  1. Enable Managed Identity on your Azure Function App
  2. Create a Role Assignment for your Function App on the Service Bus resource with the Azure Service Bus Data Receiver role
  3. In your code, initialize the ServiceBusClient class with the DefaultAzureCredential or ManagedIdentityCredential

You can refer to this sample which showcases the same but with App Service.

PramodValavala
  • 6,026
  • 1
  • 11
  • 30