1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

doc

Edge Application - Edge Functions Instances

Edge Functions module allows you to instantiate serverless functions in your Edge Application at Azion, as well as set up conditions for its execution.

Available for Edge Application and Edge Firewall products. Once it runs serverless functions in our robust distributed network of Edge Nodes, it responds to events closer to the end user, ensuring greater scalability and availability.

In this documentation, you will learn how to instantiate and execute the functions in your Edge Application.

  1. Basics
  2. How to set up your Edge Functions
  3. Related documentation

1. Basics

Before you start adding Edge Functions to your Edge Application, consider the following:

Activating Edge Functions

The first step is to access your Edge Application and activate the Edge Functions module in Main Settings, as detailed below, in How to set up your Edge Functions.

This way, you can start using the functions provided by Azion, such as: A / B Testing; Massive Redirect; Hello World, Cookie Targeting, among others.

Instantiating an Edge Function

When instantiating an Edge Function, it is not possible to change its source code, just inform the arguments that will be passed to the context of the function’s execution, in JSON, through the Args tab.

Attention, the Args field in Edge Functions Instance supports a maximum of 100KB of arguments.

To associate an execution trigger, you simply need for the instance to be associated with a Behavior of a Rules Engine rule, in the Request or Response Phase. Thus, when a request meets the criteria defined in the Rules Engine rules, the Edge Function will be invoked and executed directly on Azion’s Edge Nodes.

To learn more about how they work and how to apply some of these Edge Functions, visit our Use Cases.


2. How to set up your Edge Functions?

Follow these steps to instantiate and execute the functions in your Edge Application:

  1. From the Real-Time Manager, access the Edge Applications menu.
  2. Select one Edge Application.
  3. In the Main Settings tab, activate the Edge Functions module.
  4. In the Functions tab, click Add function to instantiate the function among the options.
  5. Still in Functions, select the Args tab, and fill in the required information.
  6. Click the Save button and you will have instantiated your Edge Function.
  7. Then, select the Rules Engine tab and add a rule in the Request or Response Phase.
  8. When creating your rule, choose Run Function in Behavior.
  9. Click the Save button and your function will be executed when there is an HTTP request.

Access the Real-Time Metrics to follow the invocations and get real-time information about the performance of your Edge Functions.



Didn’t find what you were looking for? Open a ticket.