I have a project with several Azure Functions and in the Main function where the startup is configured I register middleware like this:
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(builder =>
{
builder.UseMiddleware<MyMiddleware>();
})
This cause the middleware to be used on all functions, whether they are time triggered or HTTP request triggered. I want to be able to exclude the middleware for certain functions, or for all time triggered functions. Is this possible and how would one do it?