I have some problems in running the azure function (isolated one) based on .net 6. I would like to get the connection string to the service bus from azure app config. All other settings are succesfuly fetched and served with IOptions pattern: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-6.0 With connection string to service bus, I am getting following error when I am trying to run the function locally:
Microsoft.Azure.WebJobs.Extensions.ServiceBus: Service Bus account connection string 'AzureServiceBus' does not exist. Make sure that it is a defined App Setting.
The functioln looks like this:
using Api.Contracts.BusMessage;
namespace Api.Functions.Queues;
public class Test
{
private const string FunctionName = "func";
private readonly ILogger<Test> _logger;
public Test(ILogger<Test> logger)
{
_logger = logger;
}
[Function(FunctionName)]
public async Task Run(
[ServiceBusTrigger("func", Connection = "AzureServiceBus")]
BusMessage<string> message)
{
_logger.LogInformation("Processing queue trigger message {@Message}", message);
}
}
Is it even possible to get connection string from Azure App Configuration?