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).
Initializing
Section titled InitializingThe 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.
Usage
Section titled Usage azioncli edge_applications init
Flags
Section titled FlagsThe --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
azioncli edge_applications init --name <"application_name"> --type static
- Next.js
azioncli edge_applications init --name <"application_name"> --type nextjs
- CDN
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:
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:
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.
Building
Section titled BuildingThe 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.
Usage
Section titled Usage azioncli edge_applications build
Flags
Section titled FlagsThe 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.
Publishing
Section titled PublishingThe final step in creating an edge application is publishing it on the Azion platform. The publish
command performs this task automatically.
Usage
Section titled Usage azioncli edge_applications publish
Flags
Section titled FlagsThe 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.
Deleting
Section titled DeletingThe delete
command is used when you want to delete an edge application.
Usage
Section titled Usage azioncli edge_applications delete --application-id 1234
Flags
Section titled FlagsApplication id
Section titled Application idThe --application-id
is the unique identifier of your edge application.
The --help
option displays more information about the describe
command.
Describing
Section titled DescribingThe describe
command displays information about a specific edge application that matches the given ID, showing the application’s attributes in detail.
Usage
Section titled Usage 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
Flags
Section titled FlagsApplication ID
Section titled Application IDThe --application-id
option is the unique identifier of your edge application.
Format
Section titled FormatThe --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>
.
Listing
Section titled ListingThe list
command is used when you want to list your edge applications.
Usage
Section titled Usage azioncli edge_applications list
Flags
Section titled FlagsDetails
Section titled DetailsThe --details
option displays all relevant fields of your edge application.
Filter
Section titled FilterThe --filter
option filters the applications by their names.
The --help
option displays more information about the describe
command.
Order by
Section titled Order byThe --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).
Page size
Section titled Page sizeThe --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>
.