Azion CLI edge applications command and its subcommands

See the command and subcommands that enable the creation and management of your edge applications on the Azion Platform using the Azion Command-Line Interface (CLI).


The initialization process creates the necessary environment for building your edge application. To do this, you must first:

  • Choose one of the available types in the CLI:
    • Next.js
    • Static
    • CDN
  • Initialize a JavaScript project with Node.js runtime environment.
Terminal window
azioncli edge_applications init

The --name option can be specified, but it isn’t mandatory. If it isn’t informed, the name of your project will be the same one that is in your package.json file.

The --type option can be specified, but it isn’t mandatory. If it isn’t informed, the type of your project will be autodetected.

The CLI currently provides three templates and the type cdn for building edge applications that follow --type:

  • Static
Terminal window
azioncli edge_applications init --name <"application_name"> --type static
  • Next.js
Terminal window
azioncli edge_applications init --name <"application_name"> --type nextjs
  • CDN
Terminal window
azioncli edge_applications init --name <"application_name"> --type cdn

Note: if there’s no package.json configuration file in your edge application directory, the CLI will return the following error message:

Terminal window
Error: Failed to find package.json in current directory. Verify if you are currently in your project's directory

In that case, create a package.json configuration file for your project in the same directory as your edge application. Then rerun the command in order to initialize the application.

Tip: the best solution for creating a package.json file is to start a Node.js project in your edge application directory. To do so, use the command below from the Node.js runtime environment:

npm init -y

Command response in terminal:

Terminal window
Wrote to /Users/<user_name>/web-app-proj/package.json:
{
"name": "web-app-proj",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

The --no option forces a no response to all user inputs.

The --yes option forces a ‘yes’ response to all user inputs.


The second step in creating an edge application is to build it based on the attributes provided in the init command. The command used to build the application is the build command.

Terminal window
azioncli edge_applications build

The only flag available for the build command is --help, which displays a brief help screen.

Note: a requirement for using the build command is the presence of the webPack framework installed on your computer.


The final step in creating an edge application is publishing it on the Azion platform. The publish command performs this task automatically.

Terminal window
azioncli edge_applications publish

The only flag available for the publish command is --help, which displays a brief help screen.

Note: publishing an edge application via RTM or CLI isn’t an instantaneous process. There’s a time to propagate and configure the application in Azion’s edge locations. It may be necessary to wait a few minutes for the URL to be activated and the application page to be effectively displayed in the browser.


The delete command is used when you want to delete an edge application.

Terminal window
azioncli edge_applications delete --application-id 1234

The --application-id is the unique identifier of your edge application.

The --help option displays more information about the describe command.


The describe command displays information about a specific edge application that matches the given ID, showing the application’s attributes in detail.

Terminal window
azioncli edge_applications describe --application-id 4312
azioncli edge_applications describe --application-id 1337 --out "./tmp/test.json" --format json
azioncli edge_applications describe --application-id 1337 --format json

The --application-id option is the unique identifier of your edge application.

The --format option changes the output format passing the JSON value to the flag.

The --help option displays more information about the describe command.

The --out option exports the output to the given <file_path/file_name.ext>.


The list command is used when you want to list your edge applications.

Terminal window
azioncli edge_applications list

The --details option displays all relevant fields of your edge application.

The --filter option filters the applications by their names.

The --help option displays more information about the describe command.

The --order_by option sorts the output based on the selected field.

The --page option returns a page of the list according to its number (default 1).

The --page_size option defines how many items should be returned per page (default 10).

The --sort option defines the order of the items on the list. The options are <asc|desc>.