Created
September 18, 2025 14:27
-
-
Save skarllot/c3261145467dbe1deadd382558ef7097 to your computer and use it in GitHub Desktop.
Detect kind of trigger in middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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