Azion CLI create

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


Terminal window
azion create edge-application --name "naruno"

The --name flag sets the name of the edge application being created. It’s required if the --file flag isn’t used.

The --address option specifies the address of the origin server.

The --browser-cache-settings option configures the amount of time that content is cached in the user’s browser. Possible values are honor or override.

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

The --browser-cache-settings-maximum-ttl option defines the maximum time to live (TTL) of cached resources in the browser. It sets a time limit for how long resources can be cached in the browser, in seconds.

The --cdn-cache-settings option configures how Azion caches content at the edge. Possible values are honor or override.

cdn-cache-settings-maximum-ttl
Section titled cdn-cache-settings-maximum-ttl

The --cdn-cache-settings-maximum-ttl option defines the maximum time to live (TTL) of cached resources in the edge. It sets a time limit for how long resources can be cached on the edge nodes, in seconds.

The --delivery-protocol option specifies whether the data should be delivered via HTTP or HTTPS.

The --host-header option allows customization of the Host header.

The --http-port flag specifies the edge application’s HTTP delivery port. The default is 80.

The --https-port flag specifies the edge application’s HTTPS delivery port. The default is 443.

The --http3 option enables delivery in HTTP/3.

The --file option specifies a path to a JSON file containing the attributes of the edge application being created. It can also read from stdin using -.

Attributes inside a JSON file:

{
"name": "borus",
"delivery_protocol": "http",
"origin_type": "single_origin",
"address": "www.new.api",
"origin_protocol_policy": "preserve",
"host_header": "www.new.api",
"browser_cache_settings": "override",
"browser_cache_settings_maximum_ttl": 20,
"cdn_cache_settings": "honor",
"cdn_cache_settings_maximum_ttl": 60
}

The --origin-protocol-policy option specifies the type of connection between the edge nodes and the origin. Possible values are preserve, http, or https.

The --origin-type option specifies the type of the origin. Possible values are single_origin (default value), load_balancer, or live_ingest.

The --supported-ciphers option determines which cipher suite will be used in the TLS connections of your edge application.

The --websocket option allows you to establish the WebSocket communication protocol between your application and your users under the reverse proxy architecture.

The --debug-rules option allows you to check whether rules or rule sets created using the Rules Engine module for Edge Application or Edge Firewall have been successfully executed in your application.


Terminal window
$ azion create edge-function --name "<function_name>" --code "<path_to_code>" --active <true_or_false> [--args "<path_to_args_file>"] [--file "<file_path>"]

The --name flag sets the name of the edge function being created.

The --code flag sets the path to the edge function’s code.

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

The --args flag sets the path to the edge function’s arguments JSON file.

The --file flag specifies the file path to create an edge function. 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 create edge-function command.


Terminal window
azion create rules-engine --application-id 1679423488 --phase "response" --file `./file.json`

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

The --phase flag specifies the phase for the rule. It’s either request or response.

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

The --help flag displays more information about the azion create rules-engine action.


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

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

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

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 created. You can use - for reading from stdin.

The --help option displays more information about the azion create 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.


Creates a domain.

Terminal window
azion create domain --application-id 1231 --name "domainName"

The --application-id flag sets the edge application’s unique identifier.

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

The --active option specifies if the domain is active. The default value is true.

The --cname-access-only option specifies if the domain is accessed only through the CNAMEs. The default value is false.

The --cnames option is a list of domains’ CNAMEs to associate with the domain.

The --digital-certificate-id option sets the digital certificate’s unique identifier. It can be an integer or null.

The --help option displays more information about the azion create domain action.

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

Attributes inside a JSON file:

{
"cnames": [],
"name": "one",
"edge_application_id": 1234635841,
"cname_access_only": false,
"is_active": false
}

Terminal window
$ azion create origin --application-id <application-id> --name "<origin-name>" --addresses "<comma-separated-addresses>"

The --application-id flag sets the unique identifier for the edge application in which the origin will be created.

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

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

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

Attributes inside a JSON file:

{
"name": "Create Or22i21231222n2",
"addresses": [
{
"address": "httpbin.org"
}
],
"host_header": "asdf.asdfom"
}

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

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

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

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

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

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 --origin-protocol-policy flag tells the protocol policy used in the origin.

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

  • single_origin (default)
  • load_balancer
  • live_ingest
  • object_storage

The --bucket flag informs the name of the Edge Storage bucket. Required when origin-type is equal to object_storage.

The --bucket flag informs the path or location within the bucket from which the content must be retrieved. Optional and only used when origin-type is equal to object_storage

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


Create a new environment variable or secret to be used inside your edge functions.

Terminal window
azion create variables --key "Content-Type" --value "string" --secret false

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

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

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 the variable being created. You can use - for reading from stdin.

The --help option displays more information about the azion create variables command.


Terminal window
azion create personal-token --name "newToken" --expiration "9m"

The --file option informs the file path to a JSON file containing all attributes of the personal token being created.

Example

Terminal window
{
"name": "my token",
"expires_at": "9m"
}

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

Required flags when --file isn’t informed

Section titled Required flags when --file isn’t informed

The --description option informs the personal token’s description.

The --expiration option informs the personal token’s expiration.

The --name option informs the personal token’s name.


Terminal window
azion create edge-storage bucket --name "zorosola" --edge-access 'read_only'

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

The --name flag defines the name of the Edge Storage bucket.

The --file option specifies the path to a JSON file containing the attributes of the bucket that will be created. Alternatively, you can use ’-’ for reading from stdin.

The --help option displays more information about the ‘create edge-storage bucket’ command.


Terminal window
$ azion create edge-storage object --bucket-name 'mynewbucket' --object-key 'path/to/my/remote/file.txt' --source './local/file.txt'

The --bucket-name flag sets the name of the Edge Storage bucket where the object will be stored.

The --object-key flag sets the name of the object to be stored in the bucket. It can also be used to indicate a full file path (such as ‘path/to/file/bucket/file.txt’).

The --source flag defines the path to the local file to be uploaded to the bucket. The path should be absolute.

The --file option allows you to specify a path to a JSON file containing the attributes of the objects to be created. You can use - for reading from stdin.

The -h or --help option displays more detailed information about the azion create edge-storage object command.