Azion CLI application
Azion CLI commands that create, list, describe, update, and delete Applications, with every flag, its type, and its default.
The Azion CLI application commands create, list, describe, update, and delete Applications, the resource that holds the delivery settings of a site or an API, such as cache settings, rules, and function instances. These commands manage the resource and do not deploy code. The options every command accepts, such as --format, --out, and -y, are on Global options.
Create
azion create application creates an application with the name and settings you pass:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--active | — | string | — | Turns the application on (true) or off (false). |
--application-accelerator | — | string | — | Turns Application Accelerator on (true) or off (false) for the application. |
--cache | — | string | — | Turns Cache on (true) or off (false) for the application. |
--debug-enabled | — | string | — | Takes true or false. With true, you can check whether the application’s Rules Engine rules ran. |
--file | — | string | — | Path to a JSON file with the attributes of the application. Use - to read the JSON from standard input. |
--function | — | string | — | Turns Functions on (true) or off (false) for the application. |
--image-processor | — | string | — | Turns Image Processor on (true) or off (false) for the application. |
--name | — | string | — | Required unless --file is set. Name of the application. Without it, the command asks for the name. |
This command creates an application named my-app with Functions and Cache turned on:
The command prints the ID of the application:
List
azion list application lists the applications of your account, 50 to a page:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--details | — | — | — | Adds the LAST EDITOR, LAST MODIFIED, and DEBUG columns to the ID, NAME, and ACTIVE columns. |
--filter | — | string | — | Name to filter the list by. |
--order-by | — | string | — | Field to sort the list by. |
--page | — | int | 1 | Number of the page to return. |
--page-size | — | int | 50 | Number of applications on each page. |
This command returns the second page of a list split into pages of three applications:
The command prints one row per application:
Describe
azion describe application prints the settings of one application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--application-id | — | int | — | ID of the application to describe. |
This command describes the application with ID 1234567890:
The command prints the ID, the name, and the state of the application:
With --format json, the command prints the full object: active, debug, id, is_versioned, last_editor, last_modified, modules, name, product_version, version, version_id, and version_state. The modules object holds an enabled value for application_accelerator, cache, functions, and image_processor, which the create and update flags set.
Update
azion update application changes the name, the active state, or the settings of an application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--active | — | string | — | Turns the application on (true) or off (false). |
--application-accelerator | — | string | — | Turns Application Accelerator on (true) or off (false) for the application. |
--application-id | — | int | — | ID of the application to update. You can leave it out when the --file JSON carries "id". |
--cache | — | string | — | Turns Cache on (true) or off (false) for the application. |
--debug-enabled | — | string | — | Takes true or false. With true, you can check whether the application’s Rules Engine rules ran. |
--file | — | string | — | Path to a JSON file with the attributes to change. Use - to read the JSON from standard input. |
--functions | — | string | — | Turns Functions on (true) or off (false) for the application. |
--image-processor | — | string | — | Turns Image Processor on (true) or off (false) for the application. |
--name | — | string | — | New name of the application. |
A value other than true or false in these flags is refused with Error: The given data isn’t a boolean type value. Provide a valid boolean type in the command’s flag value and try again.
The command needs at least one field to change. With --application-id alone, it changes nothing and fails with this error:
This command renames the application with ID 1234567890 to my-app-renamed and turns debugging on:
The command prints the ID of the updated application:
Delete
azion delete application deletes an application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--application-id | — | int | — | ID of the application to delete. |
--cascade | — | — | true | Deletes the resources that azion deploy created, as listed in azion/azion.json of the current directory. Without that file, the command fails and keeps the application. |
--config-dir | — | string | "azion" | Relative path to the folder that holds your azion.json and args.json files. |
This command deletes the application with ID 1234567890 and nothing else:
The command confirms the deletion:
Use a JSON file
azion create application and azion update application read the attributes of the application from a JSON file with --file.
This file creates an active application named my-site. The command reads name and active from it:
Pass the file to the create command:
The command prints the ID of the application:
On update, the command also reads "id" from the file, so --application-id is not needed. This file renames the application with ID 1234567891 and keeps it active:
Pass the file to the update command:
The command prints the ID of the updated application:
The same file also works with --application-id 1234567891 on the command line.