Skip to content

Instantly share code, notes, and snippets.

@skarllot
Created September 18, 2025 14:27
Show Gist options
  • Save skarllot/c3261145467dbe1deadd382558ef7097 to your computer and use it in GitHub Desktop.
Save skarllot/c3261145467dbe1deadd382558ef7097 to your computer and use it in GitHub Desktop.
Detect kind of trigger in middleware
internal class MyMiddleware : IFunctionsWorkerMiddleware
{
public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next)
{
var triggerType = context.FunctionDefinition.InputBindings.Values.First(a => a.Type.EndsWith("Trigger")).Type;
var logger = context.GetLogger<MyMiddleware>();
logger.LogInformation($"TriggerType: {triggerType}");
await next(context);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment