# Azion CLI application

The Azion CLI `application` commands create, list, describe, update, and delete [Applications](/en/documentation/platform/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](/en/documentation/devtools/cli/globals/).

---

## Create

`azion create application` creates an application with the name and settings you pass:

```bash
azion create application [flags]
```

| Flag                        | Short | Type   | Default | Description                                                                                                                                                    |
| --------------------------- | ----- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--active`                  | —     | string | —       | Turns the application on (`true`) or off (`false`).                                                                                                            |
| `--application-accelerator` | —     | string | —       | Turns [Application Accelerator](/en/documentation/platform/applications/application-accelerator/settings/) on (`true`) or off (`false`) for the application.   |
| `--cache`                   | —     | string | —       | Turns [Cache](/en/documentation/platform/applications/cache/cache-settings/) 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](/en/documentation/platform/applications/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](/en/documentation/platform/functions/) on (`true`) or off (`false`) for the application.                                                     |
| `--image-processor`         | —     | string | —       | Turns [Image Processor](/en/documentation/platform/applications/image-processor/settings/) 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:

```bash
azion create application --name my-app --function true --cache true
```

The command prints the ID of the application:

```text
Created Application with ID 1234567890
```

---

## List

`azion list application` lists the applications of your account, 50 to a page:

```bash
azion list application [flags]
```

| 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:

```bash
azion list application --page 2 --page-size 3
```

The command prints one row per application:

```text
ID          NAME                    ACTIVE
1234567896  my-blog                 true
1234567897  my-store                true
1234567898  my-api                  true
```

---

## Describe

`azion describe application` prints the settings of one application:

```bash
azion describe application [flags]
```

| Flag               | Short | Type | Default | Description                        |
| ------------------ | ----- | ---- | ------- | ---------------------------------- |
| `--application-id` | —     | int  | —       | ID of the application to describe. |

This command describes the application with ID `1234567890`:

```bash
azion describe application --application-id 1234567890
```

The command prints the ID, the name, and the state of the application:

```text
ID:       1234567890
Name:     my-app
Active:   true
Debug:    false
```

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:

```bash
azion update application [flags]
```

| 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:

```text
Error: Inform at least one field to be updated. It's not possible to update an Application without specifying the fields that will be updated. Run ‘azion update edge-application --help’ to display more information and try again.  If the error persists, contact Azion support.
```

This command renames the application with ID `1234567890` to `my-app-renamed` and turns debugging on:

```bash
azion update application --application-id 1234567890 --name my-app-renamed --debug-enabled true
```

The command prints the ID of the updated application:

```text
Updated Application with ID 1234567890
```

---

## Delete

`azion delete application` deletes an application:

```bash
azion delete application [flags]
```

| 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.                                                                                              |

> **Caution**
>
> Any `--cascade` flag, `--cascade=false` included, deletes the resources listed in `azion/azion.json` of the current directory. To delete only the application, leave `--cascade` out.

This command deletes the application with ID `1234567890` and nothing else:

```bash
azion delete application --application-id 1234567890 -y
```

The command confirms the deletion:

```text
Application 1234567890 was successfully deleted
```

---

## 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:

```json
{
  "name": "my-site",
  "active": true
}
```

Pass the file to the create command:

```bash
azion create application --file app-create.json
```

The command prints the ID of the application:

```text
Created Application with ID 1234567891
```

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:

```json
{
  "id": 1234567891,
  "name": "my-site-updated",
  "active": true
}
```

Pass the file to the update command:

```bash
azion update application --file app-update.json
```

The command prints the ID of the updated application:

```text
Updated Application with ID 1234567891
```

The same file also works with `--application-id 1234567891` on the command line.

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The options every command accepts, such as `--format`, `--out`, and `-y`.
- [Applications](/en/documentation/platform/applications.md): What an application holds and how it delivers a site or an API.
- [Azion CLI deploy](/en/documentation/devtools/cli/deploy.md): How a project is deployed, and which resources a cascade delete then removes.
- [Azion CLI rules-engine](/en/documentation/devtools/cli/resources/rules-engine.md): The commands that create and manage the rules an application runs.
