Manage your edge functions using the Azion CLI. It’s common for an edge application to use several functions present in an Edge Library.
1. PrerequisitesSection titled 1. Prerequisites
- Install Azion CLI.
- Create a personal token or use an existing one that identifies you on the Azion’s platform.
2. Listing you functionsSection titled 2. Listing you functions
Initially, you can list the edge functions available in your library, including the pre-configured
Azion - Hello World function.
To list your edge functions, run the command:
A list of your functions will be presented on the monitor, as in this example:
azioncli edge_functions list command responded with a table consisting of four columns:
- ID: unique identifier of the edge function on the Azion’s platform.
- NAME: name of the function.
- LANGUAGE: programming language or framework of the function.
- ACTIVE: status of the function, which can be active (true) or inactive (false).
3. Creating an edge functionSection titled 3. Creating an edge function
After running the command, verify the creation of the
my-func.js file with the
The CLI responds with the ID of the newly created function. To confirm it, use the list command again:
Relative to the list in the previous example, this time the list command included the
my-new-ef function with ID 6823, created by the create command.
4. Deleting an edge functionSection titled 4. Deleting an edge function
To delete the newly created
my-new-ef function, run the delete command with the ID parameter of the function:
Run the list command again. The CLI will present the following table:
Note that the
my-new-ef function, whose ID was 6823, no longer appears in the list. As a suggestion, you can access RTM to analyze the results of the CLI commands presented in this example.