Main Settings
Look up the settings of an Application: its name, the Platform Resources turned on in it, Debug Rules, and its status.
Main Settings is the set of values that apply to an Application as a whole: its name, the Platform Resources turned on in it, whether it logs the rules each request runs, and whether it is active. Azion Console groups them in the Main Settings tab of the Application, and the API returns them as fields of the Application. For the path a request takes through an Application, refer to How Applications works.
Sections and fields
In Azion Console, the Main Settings tab of an Application has four sections: General, Modules, Debug Rules, and Status. The tab carries Cancel and Save, and a change is saved with Save.
Each section maps to one or more fields of the Application in the API. The last column holds the value each field takes when a create request sends only name and active.
| Section | Setting | API field | Type | Value at creation |
|---|---|---|---|---|
| General | Name | name |
string, 1 to 100 characters | The value the create request sends |
| Modules | One switch per Platform Resource | modules.<product>.enabled |
boolean | true for cache and functions, false for application_accelerator and image_processor |
| Debug Rules | Active | debug |
boolean | false |
| Status | Active | active |
boolean | The value the create request sends, or true when the request omits it |
For example, an Application you create through the API with only name and active has Cache and Functions on from the start. Application Accelerator stays off until you turn it on.
The status, the active boolean in the API, turns the Application off and back on without deleting it.
Platform Resources
In Azion Console, the switches that turn Platform Resources on or off for one Application sit in the Modules section, and each Application keeps its own set. Its Default Modules group holds one switch per Platform Resource: Application Accelerator, Cache, Functions, and Image Processor. A Subscription modules group carries a Contact sales action, and the section states Some modules require subscription.
| Platform Resource | Key in modules |
CLI flag | What it covers in the Application |
|---|---|---|---|
| Application Accelerator | application_accelerator |
--application-accelerator |
The behaviors marked - Required Application Accelerator, and the ${request_uri} variable |
| Cache | cache |
--cache |
Caching of the content the Application delivers |
| Functions | functions |
--function on create, --functions on update |
Function Instances, invoked by a Run Function behavior |
| Image Processor | image_processor |
--image-processor |
The Optimize Images behavior |
In Azion Console, the Rules Engine form marks a behavior whose Platform Resource is off with - Required Application Accelerator, - Required Function, or - Required Image Processor. A cache setting also needs Application Accelerator for the variations in its modules.application_accelerator object, and for a Max Age, its modules.cache.max_age field, below 60 seconds.
Cache settings and Function Instances belong to the Application, outside Main Settings. A Set Cache Policy behavior applies a cache setting, and a Run Function behavior invokes a Function Instance. Cache quickstart and Instantiate a function on an application show where to create each one in Azion Console.
Cache is always on in an Application: the API refuses modules.cache.enabled set to false with error 31001, Cache Cannot Be False. Azion Console shows the Cache switch locked on, with the note Automatically enabled in all accounts. You can turn another Platform Resource on when your account supports it, and off when nothing in the Application depends on it. Turning on a Platform Resource can generate usage-related costs. For more information, refer to Pricing.
While Application Accelerator is off, the API refuses a request rule whose criterion reads ${request_uri}. It also refuses a cache setting that varies the cache by method, query string, cookie, or device group, or that sets a Max Age below 60 seconds. Each refusal carries one of the codes in Errors, and the same rule on ${uri} is accepted. For the variables and behaviors each Platform Resource adds, refer to Rules Engine for Applications.
Tiered Cache is not one of the four modules switches of an Application: it is a Feature of Cache, and each cache setting turns it on in its modules.cache.tiered_cache.enabled field.
Debug Rules
Debug Rules logs the Rules Engine rules that run on each request to the Application. The setting is off when you create an Application, and the API holds it in the debug boolean. In Azion Console, the Active switch of the Debug Rules section sets it. In Azion CLI, --debug-enabled sets it on azion create application and azion update application.
With Debug Rules on, the rules that ran on a request appear in the $traceback field of Data Stream and Real-Time Events. The Real-Time Events GraphQL API returns the same rules in the stacktrace field. A rule that is missing from that list did not run on the request.
For example, a Set Cache Policy rule can seem to have no effect on a path. The $traceback of a request to that path then shows whether the rule ran at all. For the queries that read the field in each tool, refer to Debug rules created with Rules Engine.
Delivery and protocol settings
Domains, protocols, and certificates belong to a Workload, so you configure delivery on the Workload, not in Main Settings. A Workload receives each request, and the deployment of that Workload sets the Application that processes the request. In Azion Console, you set that Application in the Application field of the Workload’s Deployment Settings.
In an account that has not migrated to API v4, the Application itself holds its delivery protocols, ports, and TLS settings. For those settings, refer to Main Settings | v3.
API
The API serves your Applications at https://api.azion.com/v4/workspace/applications. Each call authenticates with a personal token in the Authorization: Token [TOKEN VALUE] header, and a call with a body also sends Content-Type: application/json.
| Operation | Method and path |
|---|---|
| Create an Application | POST /workspace/applications |
| List the Applications of the account | GET /workspace/applications |
| Read one Application | GET /workspace/applications/<application-id> |
| Replace an Application | PUT /workspace/applications/<application-id> |
| Change part of an Application | PATCH /workspace/applications/<application-id> |
| Delete an Application | DELETE /workspace/applications/<application-id> |
| Clone an Application | POST /workspace/applications/<application-id>/clone |
A create and a PATCH answer 202, with state set to pending. A list and a read answer 200.
name is the only field a create request requires. This call creates an Application from a name and a status alone:
The API answers 202. In this excerpt of the body, modules and debug carry the values the platform set at creation:
The id in data identifies the Application in every later call, including the paths of its rules, such as /workspace/applications/<application-id>/request_rules.
This call turns on Application Accelerator on an existing Application:
The API answers 202 with state set to pending. A body with functions in place of application_accelerator turns on Functions the same way, and its response repeats the modules object with all four keys.
CLI
Azion CLI reads and changes an Application with six commands under the application noun. Each flag of a Platform Resource takes a string, such as true.
| Command | What it does | Flags |
|---|---|---|
azion create application |
Creates an Application | --name, --active, --debug-enabled, --application-accelerator, --cache, --function, --image-processor, --file |
azion update application |
Changes the Application that --application-id names |
--application-id, --name, --active, --debug-enabled, --application-accelerator, --cache, --functions, --image-processor, --file |
azion describe application |
Returns one Application, with its modules object |
--application-id |
azion list application |
Lists the Applications of the account | --details, --filter, --order-by, --page, --page-size |
azion delete application |
Deletes the Application that --application-id names |
--application-id, --cascade |
azion clone application |
Copies an Application under the name in --name |
--application-id, --name |
The Functions flag is --function on azion create application and --functions on azion update application. On azion delete application, --cascade also deletes the resources that azion deploy created, and it defaults to true.
This command turns on Application Accelerator:
The output of azion describe application includes the modules object of the Application:
On an Application with all four Platform Resources on, the object reads:
Errors
A Platform Resource that is off in the Application surfaces as a refusal of the object that needs it, with 400. Each of these refusals names Application Accelerator, except 31001, which refuses turning Cache off. This body answers a request rule on ${request_uri}:
meta.missing_required_modules lists the keys to turn on in the modules object of the Application.
| Code | Title | Status | What causes it | What to do |
|---|---|---|---|---|
25047 |
Missing Required Modules |
400 | A request rule whose criteria read ${request_uri}, on an Application with Application Accelerator off |
Turn on Application Accelerator, or match on ${uri}, which the API accepts without it |
21013 |
This Configuration Requires The Edge Application's Application Accelerator Module |
400 | A cache setting that varies the cache by method, query string, cookie, or device group, on an Application with Application Accelerator off. The pointer names the variation, such as /data/modules/application_accelerator/cache_vary_by_method |
Turn on Application Accelerator, then save the cache setting again |
21021 |
Edge Cache Max Age Lower Than The Minimum Allowed By Application's Application Accelerator Module |
400 | A cache setting whose modules.cache.max_age is below 60, on an Application with Application Accelerator off. meta.min_value is 60 |
Turn on Application Accelerator, or set modules.cache.max_age to 60 seconds or more |
31001 |
Cache Cannot Be False |
400 | A PATCH that sets modules.cache.enabled to false |
Leave Cache on: it cannot be turned off |