How to run serverless functions on Azion

Edge Functions is a module of the Azion Edge Platform that allows you to program and execute serverless functions.

Go to Edge Functions for Edge Application reference

To run a function, you must:

  • Create your own function or use any of those already available on Azion Marketplace.
  • Instantiate a function in an edge application.
  • Define activation triggers within Rules Engine.

Creating a new edge function

To create an edge function:

  1. Access Azion Console > Edge Functions.
  2. Click on + Edge Function.
  3. Choose a name for your function.
  4. Write your code.
  5. Click the Save button.

Instantiating an edge function

To demonstrate how to instantiate and run a function on an edge application, this guide will use the pre-configured Azion - Hello World function. To instantiate an edge function on an edge application:

  1. Access Azion Console > Edge Application.
  2. Click on the edge application to which you want to add a function.
  3. Go to the Functions Instances tab.
  4. Click + Function Instance.
  5. Name your function instance. For example: Hello World function.
  6. Select the Azion - Hello World function.
  7. Click the Save button.

Configuring function activation criteria

  1. In the same edge application, go to the Rules Engine tab.
  2. Click + Rule.
  3. Give your rule a name.
  4. Select Request Phase.
  5. In the Criteria section, select:
    • If ${uri} is equal /hello-world.
  6. In the Behaviors section, choose Run Function.
  7. Select the Hello World function
  8. Click Save.

Wait a few minutes for the propagation to be completed.

To see your instanced function, access your application using its domain and the URI set in the rule, which is in the format xxxxxxxxx.map.azionedge.net/hello-world.

Now you’ve successfully configured and instantiated an edge function in an edge application.


Contributors