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
The initialization process creates the necessary environment for building your edge application. To do this, you must first:
- Choose one of the three templates available in the CLI:
- Next.js
- Flareact
- Javascript
- Initialize a JavaScript project with Node.js runtime environment.
Usage
$ azioncli edge_applications init
Flags
Name
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.
Type
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
:
- JavaScript
$ azioncli edge_applications init --name <"application_name"> --type javascript
- Flareact
$ azioncli edge_applications init --name <"application_name"> --type flareact
- 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"
}
No
The --no
option forces a no
response to all user inputs.
Yes
The --yes
option forces a ‘yes’ response to all user inputs.
2. Building
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.
Usage
$ azioncli edge_applications build
Flags
Help
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.
3. Publishing
The final step in creating an edge application is publishing it on the Azion platform. The publish
command performs this task automatically.
Usage
$ azioncli edge_applications publish
Flags
Help
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.
4. Deleting
The delete
command is used when you want to delete an edge application.
Usage
azioncli edge_applications delete --application-id 1234
Flags
Application id
The --application-id
is the unique identifier of your edge application.
Help
The --help
option displays more information about the describe
command.
5. Describing
The describe
command displays information about a specific edge application which matches the given ID, showing the application’s attributes in detail.
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
Application ID
The --application-id
option is the unique identifier of your edge application.
Format
The --format
option changes the output format passing the JSON value to the flag.
Help
The --help
option displays more information about the describe
command.
Out
The --out
option exports the output to the given <file_path/file_name.ext>
.
6. Listing
The list
command is used when you want to list your edge applications.
Usage
azioncli edge_applications list
Flags
Details
The --details
option displays all relevant fields of your edge application.
Filter
The --filter
option filters the applications by their names.
Help
The --help
option displays more information about the describe
command.
Order by
The --order_by
option sorts the output based on the selected field.
Page
The --page
option returns a page of the list according to its number (default 1).
Page size
The --page_size
option defines how many items should be returned per page (default 10).
Sort
The --sort
option defines the order of the items on the list. The options are <asc|desc>
.
7. Related documentation
- Creating an edge application with Azion CLI
- Edge Functions Command
- Managing your Edge Functions using Azion CLI
Didn’t find what you were looking for? Open a support ticket.