You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a preInvocation and postInvocation hook is defined it will be executed for every single Function that gets executed, but there may be scenarios where you don't want them to be run every time, here's some examples:
Performing validation of an inbound HTTP payload for a POST request on a HTTP Trigger
Creating a CosmosClient to provide for Functions that can't use the input/output bindings (for removing or replacing items in a Cosmos collection)
Only executing for a certain trigger type in an app that has multiple different trigger types in use
Here's a pseudocode API:
// only apply to a specific trigger typeapp.preInvocation({hook: ()=>{},filter: 'timer'});// filter based on a function nameapp.preInvocation({hook: ()=>{},filter: (context)=>{returncontext.functionName.contains('Delete')||context.functionName.contains('Put');}});// filter based on some custom logicapp.preInvocation({hook: ()=>{},filter: (context)=>{returncontext.trigger.type==='httpTrigger'&&context.trigger.payload.method==="POST";}});
The text was updated successfully, but these errors were encountered:
Building on #7 and Azure/azure-functions-nodejs-worker#664.
When a
preInvocation
andpostInvocation
hook is defined it will be executed for every single Function that gets executed, but there may be scenarios where you don't want them to be run every time, here's some examples:CosmosClient
to provide for Functions that can't use the input/output bindings (for removing or replacing items in a Cosmos collection)Here's a pseudocode API:
The text was updated successfully, but these errors were encountered: