CyberSecurity // Azure // Frontend // Svelte // Cloud Native // Software // CyberSecurity // Azure // Frontend // Svelte // Cloud Native // Software

Azure functions part 2 triggers and bindings

Cover for Azure functions part 2 triggers and bindings

For part one, see Azure Functions : part 1

Triggers and bindings

A trigger is what causes your Azure function to run. It defines how and when your function is invoked. To have a working function, you need exactly one trigger.

A binding is a way to connect your function to other resources, such as Cosmos DB, Service Bus, Blob Storage and many others. Bindings are often available in both the in and out direction, depending on what your usecase is.

Let's clarify this with an example. Imagine a blob storage bucket that gets used to upload a bunch of excel files. At the end of every day, we want to run a function that goes over all these files, and write a summary to a database. In such case our function would need the following properties:

Trigger: Timer

Input binding: Azure Blob Storage

Output binding: Azure Cosmos Database

A trigger, input and output binding make up this Azure function

Image: A trigger, input and output binding make up this Azure function

Available triggers

The following triggers are currently supported by Azure Functions. They will provide the start signal for your function to begin execution.

Available triggers in Azure Functions

Image: Available triggers in Azure Functions

Note

Every function can be run manually by performing an http request, independently from which kind of trigger is used. This can be usefull for when you want to debug something, or manually kickstart a function. For more information see the Microsoft documentation

Available input bindings

Sometimes we need our function to retrieve data from somewhere else. This is where we need our input bindings. The following input bindings are currently available:

Available input bindings in Azure Functions

Image: Available input bindings in Azure Functions

Available output bindings

After your code has executed inside your function, you might want to send the results to another resource. Output bindings allow you to send your function's outcome to another resource.

Available output bindings in Azure Functions

Image: Available output bindings in Azure Functions