Flex Consumption Option Set binding not working

Josh Grew 0 Reputation points
2025-05-20T10:55:41.2+00:00

In this instance its causing issues where our Service Bus Triggers are no longer being hit. Removing the __ reference and referencing an app setting that does not have a prefix works fine.


  [Function(nameof(ProcessInputtedMessage))]
    public async Task ProcessInputtedMessage(
        [ServiceBusTrigger("%DmsInputQueueClientOptions__DmsInputQueue%",
            Connection = "DmsInputQueueClientOptions", IsBatched = false)]

This would previously map straight to the app settings below:


"DmsInputQueueClientOptions__fullyQualifiedNamespace"
"DmsInputQueueClientOptions__ServiceBusEndpoint" 
"DmsInputQueueClientOptions__DmsInputQueue"                

We can also see the same issue for general option set binding in the startup.


var host = new HostBuilder()
    .ConfigureFunctionsWebApplication()
    .ConfigureAppConfiguration((hostingContext, config) =>
    {
        config.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true);
        config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
        config.AddEnvironmentVariables();
    })
    .ConfigureServices(s =>
    {
        
        s.AddOptions<DmsInputQueueClientOptions>().Configure<IConfiguration>((settings, configuration) =>
        {
            configuration.GetSection("DmsInputQueueClientOptions").Bind(settings);
        });
	}
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,487 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.