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?