Azion CLI config
Azion CLI commands that create azion.json, apply an azion.config file's resources, and delete the resources azion.json lists, with every flag and its default.
The Azion CLI config commands manage Azion resources from manifest files: init creates an empty azion.json file, apply creates or updates the resources that an azion.config file declares, and delete deletes the resources that azion.json lists. The options every command accepts, such as --format, --out, and -y, are on Global options.
Usage
azion config groups the init, apply, and delete subcommands:
The command takes no flags of its own. Run it with a subcommand.
The config subcommands read and write azion.json in the current directory by default. The azion init, azion link, and azion deploy commands keep the same file in the azion folder instead. To point a config subcommand at another folder, use --config-dir.
Init
azion config init creates an azion.json file to store the state of your application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--config-dir | — | string | "." | Path to the folder where the command creates azion.json. |
--force | — | — | — | Overwrites an azion.json file that already exists. |
This command creates the file in an empty folder:
The command prints the path of the file it created:
The new azion.json holds every key with an empty value:
When the folder already holds an azion.json file, the command keeps the file and stops with Error: Configuration file already exists. To replace the file, add --force.
Apply
azion config apply reads the azion.config file of the folder and creates or updates the resources it declares on your account:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--config-dir | — | string | "." | Path to the folder that holds azion.json and the azion.config file. |
--config-file | — | string | — | Path to the azion.config file to apply, such as azion.staging.config.cjs. Where --config-dir names a folder, the one that holds azion.json and the azion.config file, --config-file names the configuration file itself. A relative path resolves from the current directory. A path to a missing file fails the command. |
This azion.config.mjs file declares an application with a cache setting and a request rule, and a workload that deploys the application:
This command applies the file from the folder that holds it and the azion.json file that config init created:
The command generates .edge/manifest.json from the file, then prints one line per resource it creates:
The command records the ID of each resource in azion.json. A second run with the same file updates the same resources by ID instead of creating new ones:
The command prints one line per resource it updates:
Delete
azion config delete deletes every resource that azion.json lists, then resets azion.json to the empty file that config init creates:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--config-dir | — | string | "." | Relative path to the folder that holds your azion.json file. |
--force | — | — | — | Deletes the resources without asking for confirmation. |
Without --force, the command asks This will delete all resources defined in azion.json. Continue? (y/N) before it deletes anything.