I am using Azure Function
v4
with .NET 8.0
as Isolated Process
and want to use multiple output binding as described here.
It looks like this:
public class MultiOutputType
{
[KafkaOutput("BrokerList",
"topic")]
public string KafkaEvent { get; set; }
public IActionResult HttpResponse { get; set; }
}
and use this class like this
[Function("test")]
public MultiOutputType Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
{
_logger.LogInformation("C# HTTP trigger function processed a request.");
var kafkaEvent = "some event string";
var httpResponse = new OkObjectResult("Test successful.");
return new MultiOutputType
{
KafkaEvent = kafkaEvent,
HttpResponse = httpResponse
};
}
Now I do not want to hardcode parameters like BrokerList
or topic
defined in KafkaOutput
but want to load these values from configuration like local.settings.json
or environment variable.
How can I set these values in the attribute from configuration?