How to run serverless functions on Azion Console

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

Learn more about Edge Functions for Edge Application

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.

To create an edge function:

  1. Access Azion Console.
  2. On the upper-left corner, click the three horizontal lines to open the Products menu.
  3. Under EDGE LIBRARIES, select Edge Functions.
  4. Click on Add Function.
  5. Choose a name for your function.
  6. Write your code.
  7. Click the Save button.

Instantiating an edge function

Section titled 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.
  2. On the upper-left corner of the page, click the three horizontal lines to open the Products menu.
  3. Under the section BUILD, select Edge Application.
  4. Click the edge application you want to add a function.
  5. Go to the Functions tab.
  6. Click Add Function.
  7. Name your function instance. For example: Hello World function.
  8. Select the Azion - Hello World function.
  9. Click the Save button.

Configuring function activation criteria

Section titled Configuring function activation criteria
  1. In the same edge application, go to the Rules Engine tab.
  2. Click New Rule and select Request Phase.
  3. Give your rule a name.
  4. In the Criteria section, select:

If ${uri} is equal /hello-world.

  1. In the Behaviors section, choose Run Function.
  2. Select the Hello World function
  3. 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