Azion CLI update

With the azion update [resource] command you can update:


Terminal window
azion update edge-application --application-id <application_id> [flags]

The --application-id flag specifies the edge application’s ID to be updated.

The --application-acceleration flag specifies if the edge application has the Application Acceleration module active.

The --delivery-protocol flag specifies the edge application’s delivery protocol.

The --device-detection flag specifies whether the edge application has Device Detection active or not.

The --edge-firewall flag specifies whether the edge application has an associated edge firewall active or not.

The --edge-functions flag specifies if the edge application has the Edge Functions module active.

The --http-port flag specifies the edge application’s HTTP Port. By default, it’s 80.

The --https-port flag specifies the edge application’s HTTPS Port. By default, it’s 443.

The --image-optimization flag specifies if the edge application has the Image Processor module active.

The --file flag specifies the given path and JSON file to automatically update the edge application attributes. You can use - for reading from stdin.

Attributes inside a JSON file:

{
"active": true,
"application_acceleration": false,
"delivery_protocol": "http,https",
"device_detection": false,
"edge_firewall": false,
"edge_functions": false,
"http_port": 80,
"https_port": 443,
"id": 1337,
"image_optimization": false,
"l2_caching": false,
"load_balancer": false,
"minimum_tls_version": "tls_1_1",
"name": "vaivaivai",
"raw_logs": false,
"web_application_firewall": false
}

The --l2-caching flag specifies if the edge application has the Tiered Cache module active.

The --load-balancer flag specifies if the edge application has the Load Balancer module active.

The --min-tls-ver flag specifies the edge application’s Minimum TLS Version.

The --name flag specifies the edge application’s name.

The --raw-logs flag specifies whether the edge application has raw logs active or not.

The --webapp-firewall flag specifies whether the edge application has Web Application Firewall active or not.

The --help option displays more information about the update action.


Terminal window
$ azion update edge-function --function-id <function_id>

The --function-id flag is the unique identifier of the edge function.

The --active flag specifies whether the edge function should be active or not. Accepts true or false.

The --args flag sets the path and name of the JSON file containing the edge function’s arguments.

The --code flag sets the path and name to the file containing the edge function’s code.

The --file flag specifies the given path and JSON file to automatically update the edge function attributes. You can use - for reading from stdin.

Attributes inside a JSON file:

{
"active": true,
"code": "async function handleRequest(request) {\n return new Response(\"Hello!\",\n {\n status:204\n })\n}\naddEventListener(\"fetch\", event =\u003e {\n event.respondWith(handleRequest(event.request))\n})",
"name": "func"
}

The --help option displays more information about the azion update edge-function command.

The --name flag sets the new name for the edge function.


Terminal window
azion update rules-engine --rule-id <rule-id> --application-id <application-id> --phase <phase> --file <rule-json>

The --rule-id flag specifies the unique identifier for the rule in Rules Engine.

The --application-id flag specifies the unique identifier for the edge application that implements these rules.

The --phase flag specifies the Rules Engine Phase. It’s either request or response.

The --file flag specifies the path to a JSON file containing the attributes of the rule that will be updated. You can use - to read from stdin.

The -h or --help flag displays more information about the azion update rules-engine command.


Terminal window
$ azion update cache-setting --application-id 1673635839 --cache-setting-id 123123421 --name "phototypesetting"

The --application-id flag sets the unique identifier for the edge application.

The --cache-setting-id flag sets the unique identifier for a Cache Settings configuration.

The --name flag sets the name of the Cache Settings configuration being updated.

The --adaptive-delivery-action option informs the Cache Settings configuration adaptive delivery action. The default value is ignore.

The --browser-cache-settings option configures the amount of time that the content is cached in the web browser. The default value is honor.

browser-cache-settings-maximum-ttl
Section titled browser-cache-settings-maximum-ttl

The --browser-cache-settings-maximum-ttl option informs Browser Cache Settings configuration maximum TTL.

The --cache-by-cookies option defines if cache by cookies is active. The default value is ignore.

The --cache-by-query-string option defines how the content should be cached according to variations of the query string in URLs. The default value is ignore.

The --cdn-cache-settings option configures the amount of time Azion’s edge applications take to cache the content. It can either Honor Origin Cache Headers or Override Cache Settings. The default value is honor.

cnd-cache-settings-maximum-ttl
Section titled cnd-cache-settings-maximum-ttl

The --cnd-cache-settings-maximum-ttl option informs CDN Cache Settings configuration maximum TTL. The default value is 60.

The --cookie-names option distinguishes objects in the Azion cache by the name/value of cookies.

The --enable-caching-for-options option defines if caching for options is active. The default value is false.

The --enable-caching-for-post option defines if caching for post is active.

The --enable-caching-string-sort option defines if caching string sort is active.

The --file option specifies the path to a JSON file containing the attributes of the Cache Settings configuration that’ll be updated. You can use - for reading from stdin.

The --help option displays more information about the azion update cache-setting command.

The --l2-caching-enabled option defines if Tiered Cache is active.

The --query-string-fields option gives a list of query string parameters to be considered in the Cache Settings configuration, segregating the cache to the same URL.

The --slice-configuration-enabled option defines if Large File Optimization is active.

The --slice-configuration-range option informs the fragment range.

The --slice-l2-caching-enabled option defines if Large File Optimization for Tiered Cache is active.


Updates a domain’s name and other attributes based on a given ID.

Terminal window
azion update domain --domain-id 1234 --name 'Hello'

The --domain-id flag specifies the unique identifier of the domain that you want to update.

The --active option sets the domain as active.

The --application-id option is the unique identifier for an edge application used by this domain.

The --cname-access-only option sets if the domain should be accessed only through CNAMEs.

The --cnames option specifies the CNAMEs of your domain.

The --digital-certificate-id option is the unique identifier of the digital certificate. This value can be either an integer or null.

The --file option specifies a given path and JSON file to automatically update the domain attributes. You can use - to read from stdin.

Attributes inside a JSON file:

{
"cname_access_only": true,
"cnames": [
"www.test123.com",
"www.aa.com"
],
"id": 1337,
"name": "name"
}

The --name option sets the domain’s name.

The -h or --help option displays more information about the azion update domain command.


Terminal window
$ azion update origin --application-id <application-id> --origin-key <origin-key>

The --application-id flag sets the unique identifier for an edge application. It’s a required field.

The --origin-key flag sets the unique identifier for an origin. It’s a required field.

The --name flag sets the name of the origin being updated.

The --addresses flag passes a list of addresses linked to the origin. Multiple addresses should be separated by commas.

The --host-header flag specifies the hostname of the server being accessed.

The --origin-type flag identifies the source of a record. Accepted values:

  • single_origin (default)
  • load_balancer
  • live_ingest
  • object_storage

The --origin-protocol-policy flag tells the protocol policy used in the origin.

The --origin-path flag defines the path to be appended to the URI when forwarding the request to the origin. Leave it blank to use only the URI.

The --hmac-authentication flag specifies whether Hmac Authentication is used or not.

The --file flag specifies the path to a JSON file containing the attributes of the origin that will be updated. You can use - for reading from stdin.

The --hmac-access-key flag informs the Hmac Access Key.

The --hmac-region-name flag informs the Hmac region name.

The --hmac-secret-key flag informs the Hmac Secret Key.

The -h or --help option displays more information about the azion update origin action.


Update an environment variable based on given attributes.

Terminal window
azion update variables --variable-id 7a187044-4a00-4a4a-93ed-d2309004019201909321f3 --key 'Content-Type' --value 'json' --secret false

Required flags if the --file flag isn’t informed

Section titled Required flags if the --file flag isn’t informed

The --variable-id flag gives the UUID for the variable being updated.

The --key flag provides the variable’s key.

The --value flag provides the variable’s value.

The --secret flag indicates whether the value is meant to be confidential. The default value is true.

The --file flag informs the file path to the file containing all attributes of variable being updated. You can use - for reading from stdin.

The --help option displays more information about the update subcommand.


Terminal window
azion update edge-storage bucket --name 'zorosola' --edge-access 'read_only'
azion update edge-storage bucket --help

The --name flag sets the name of the Edge Storage bucket that will be updated.

The --edge-access option indicates the type of permission for actions within the bucket. Possible values include ‘read_only’, ‘read_write’, or ‘restricted’.

The --file option specifies the path to a JSON file containing the attributes of the bucket to be updated. You can use - for reading from stdin.

The -h or --help option displays more information about the azion update edge-storage bucket command.


Terminal window
azion update edge-storage object --bucket-name 'mybalde' --object-key 'path/index.html' --source './index.html'
azion update edge-storage object --help

The --bucket-name flag specifies the name of the Edge Storage bucket where the object that you want to update is located.

The --object-key flag identifies the Edge Storage object in the specified bucket that you want to update.

The --source flag specifies the file path to update the edge storage bucket object.

The --file option refers to the path to a JSON file containing the attributes of the bucket that will be updated. You can use - for reading from stdin.

The -h or --help option provides more information about the azion update edge-storage object command.