Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Azure Function Triggers and Filters

Daron Yondem
December 19, 2017

Azure Function Triggers and Filters

This is part of a full day Serverless training I hosted for Microsoft Turkey in Istanbul talking about Azure Function Triggers and Function Filters.

Daron Yondem

December 19, 2017

More Decks by Daron Yondem

Other Decks in Programming


  1. Function Triggers and Bindings • A trigger defines how a

    function is invoked. • Triggers have associated data, which is usually the payload that triggered the function. • Input and output bindings provide a declarative way to connect to data from within your code.
  2. High level look of what’s available More; https://goo.gl/TEyuND Type Service

    Trigger Input Output Timer Azure Functions ✔ HTTP Azure Functions ✔ ✔ Blob Azure Storage ✔ ✔ ✔ Events Azure Event Hubs ✔ ✔ Queues Azure Storage ✔ ✔ Tables Azure Storage ✔ ✔ No-SQL Azure Cosmos DB ✔ ✔ ✔ Push Notifications Azure Notification Hubs ✔
  3. What you can do with timer triggers? • Run at

    explicitly specified intervals, like every day at 2:00 am using CRON expressions, like “0 */5 * * * *“ (every 5 minutes) • Can send information to other systems, but typically don’t “return” information, only write to logs • Great for redundant cleanup and data management • Great for checking state of services • Can be combined with other functions
  4. What are Function Filters? • Encapsulate common logic to be

    shared across many different functions • Validation, logging, error handling • Similar to ASP.NET Filters https://goo.gl/qzT1bE
  5. Filter Types • Invocation Filters - have both Executing/Executed methods

    that are called immediately before and immediately after the target job function is invoked. • Exception Filters - Exception filters will be called for exceptions occurring at any stage in the execution pipeline.
  6. Links worth sharing Imperative bindings are available for C# •

    https://goo.gl/6UDoh7 Using .NET class libraries with Azure Functions • https://goo.gl/HExTPZ More on Function Filters • https://goo.gl/51ET18