How to run scripts on edge nodes
Learn how to configure and install Azion CLI on edge nodes using Shell Script resources via Azion Console and API, including service binding and setup.
To be able to orchestrate services on your device, you must configure all the resources needed to install, uninstall, and reload your services.
This guide presents how to install Azion CLI on your edge nodes through a resource of the type Shell Script configured on a specific edge service.
Requirements
- An edge node with Orchestrator Agent installed and authorized.
- The Dpkg package manager installed on this node.
Creating an edge service
- Access Azion Console.
- On the upper-left corner of the page, open the Products menu, represented by three horizontal lines, and then select Edge Services.
- Click on the + Service button.
- Name this service
Azion CLI Installation. - Enter the variables and values for the resource, if necessary.
- Set the status as Active.
- Click the Save button.
Creating a resource
- Inside the service you’ve just created, called
Azion CLI Installation, go to the Resources tab. - Click on + Resource.
- Enter
/scripts/install-cliin the Path field. - Choose the type Shell Script.
- Choose the trigger Install.
- Add the following content to the Content block:
Shell
- Click the Save button.
This script will install the Azion binary in the following path: /usr/local/bin
Binding an edge service to an edge node
- On the upper-left corner of the page, open the Products menu, represented by three horizontal lines, and then select Edge Nodes.
- Select the edge node to which you want to bind a service.
- Go to the Services tab and click the + Service button.
- Choose the service
Azion CLI Installationyou’ve created. - Click the Save button.
Accessing Azion CLI
After this process, in your edge node, access the folder:
Run:
The output will be similar to:
Shell