Azion CLI workload
Azion CLI commands that create, list, describe, update, and delete workloads, with every flag, its type, and its default.
The Azion CLI workload commands create, list, describe, update, and delete Workloads, the resource that answers the domains of a site or an API and holds their TLS, mTLS, and port settings. The application that answers those domains is set by a deployment, which the workload-deployment commands manage. The options every command accepts, such as --format, --out, and -y, are on Global options.
Create
azion create workload creates a workload with the name you pass:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--active | — | string | "true" | Turns the workload on (true) or off (false). |
--file | — | string | — | Path to a JSON file with the attributes of the workload. Use - to read the JSON from standard input. |
--name | — | string | — | Required unless --file is set. Name of the workload. Without it, the command asks for the name. |
This command creates a workload named my-workload:
The command prints the ID of the workload:
List
azion list workload lists the workloads of your account, 50 to a page:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--details | — | — | — | Adds the ACTIVE, LAST EDITOR, and LAST MODIFIED columns to the ID and NAME 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 workloads on each page. |
This command returns the first page of a list split into pages of two workloads:
The command prints one row per workload:
Describe
azion describe workload prints the settings of one workload:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--workload-id | — | int | — | ID of the workload to describe. |
This command describes the workload with ID 1234567900:
The command prints the ID, the name, the state, and the last change of the workload:
With --format json, the command prints the full object: active, created_at, domains, id, infrastructure, last_editor, last_modified, mtls, name, product_version, protocols, tls, workload_domain, and workload_domain_allow_access. The workload_domain field holds the domain Azion generates for the workload, which ends in .map.azionedge.net.
An ID that does not exist fails with this error:
Update
azion update workload changes the name, the active state, or the domains of a workload:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--active | — | string | "true" | Turns the workload on (true) or off (false). |
--domains | — | strings | — | List of domains the workload answers. The --alternate-domains flag of the command’s help example does not exist and fails with Error: unknown flag: --alternate-domains. |
--file | — | string | — | Path to a JSON file with the attributes to change. Use - to read the JSON from standard input. |
--name | — | string | — | New name of the workload. |
--workload-id | — | int | — | ID of the workload to update. |
The command reads the ID of the workload from the "id" field of the --file JSON. An update made with flags alone fails with this error, even when --workload-id carries a valid ID:
This file renames the workload with ID 1234567901 to my-site-updated:
Pass the file to the update command:
The command prints the ID of the updated workload:
Fields left out of the file keep their values.
Delete
azion delete workload deletes a workload:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--workload-id | — | int | — | ID of the workload to delete. |
This command deletes the workload with ID 1234567900:
The command confirms the deletion:
Use a JSON file
azion create workload and azion update workload read the attributes of the workload from a JSON file with --file.
This file creates an active workload 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 workload:
On update, the file carries "id" and the fields to change, such as name or domains, as shown in Update. The domains field takes a list of domains. The API refuses a domain your account is not allowed to use. This file lists www.example.com in the domains of the workload with ID 1234567901:
The command fails with this error: