0

I'm trying to use Managed Identity to authenticate my Azure function against Azure Service Bus, however, I feel like I'm missing a key piece of the puzzle. I'm using the following package:

<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="4.2.1" />

And the function looks like this:

    [Function("MyFunction")]
    public void Run([ServiceBusTrigger("myqueue", Connection = "")] string message, FunctionContext context)
    {
        var logger = context.GetLogger("MyFunction");
        logger.LogInformation($"C# ServiceBus queue trigger function processed message: {message}");

Running this just tells be that the connection string is empty - which, to be fair, it is. But I thought that using Managed Identity, I'd be able to authenticate myself without using a connection string (i.e., I could just tell it to use DefaultAzureCredentials, and perhaps the namespace).

Am I correct in my assumption? If so, is there a new / different library to use?

  • Does this answer your question? [How to use Azure Managed Identity in Azure Function to access Service Bus with a trigger?](https://stackoverflow.com/questions/51932986/how-to-use-azure-managed-identity-in-azure-function-to-access-service-bus-with-a) – user1672994 Aug 08 '21 at 04:51
  • Thanks - it does partly, but how do I tell it which Managed Identity to use (i.e. DefaultAzureCredentials, EnvironmentCredentials, etc..? –  Aug 08 '21 at 10:00
  • Use the defaultazurecredentials – Thomas Aug 21 '21 at 05:11

0 Answers0