Main Settings
Look up the settings of an application: its name, the Products enabled on it, Debug Rules, and its status.
Main Settings is the set of values that apply to an application as a whole: its name, the Products enabled on it, Debug Rules, and its status. Azion Console groups them in the Main Settings tab of the application, and the API returns them as fields of the application object. For the path a request takes through an application, refer to How Applications works.
Sections and fields
The Main Settings tab has four sections: General, Modules, Debug Rules, and Status. General holds the Name of the application. 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 | The value the create request sends |
| Modules | One toggle per Product | modules.<product>.enabled | boolean | true for cache and functions, false for application_accelerator and image_processor |
| Debug Rules | Debug Rules | debug | boolean | false |
| Status | Status | active | boolean | The value the create request sends |
For example, an application you create through the API with only name and active has Cache and Functions on from the start, and Application Accelerator stays off until you turn it on.
The Status toggle turns the application off and back on without deleting it. The API carries the same state in the active boolean.
Products
The Modules section turns Products on or off for one application, and each application keeps its own set. Its Default Modules group holds one toggle per Product: Application Accelerator, Cache, Functions, and Image Processor. A Subscription modules group carries a Contact sales action, and the section states that “Some modules require subscription.”
| Product | Key in modules | CLI flag | What it covers on the application |
|---|---|---|---|
| Application Accelerator | application_accelerator | --application-accelerator | The Rules Engine variables and behaviors that the Console marks - Required Application Accelerator. A cache setting needs it for the variations of its Application Accelerator section and for a Max Age below 60 seconds |
| Cache | cache | --cache | Caching of the content the application delivers. Cache settings are created in the Cache Settings tab and applied by a Set Cache Policy behavior |
| Functions | functions | --functions | Function instances, listed in the Functions Instances tab and run by a Run Function behavior. The Console marks a behavior that needs Functions - Required Function |
| Image Processor | image_processor | --image-processor | The Optimize Images behavior. The Console marks a behavior that needs Image Processor - Required Image Processor |
Cache is on when you create an application, and the Console notes that it is “Automatically enabled in all accounts.” You can turn a Product on when your account supports it, and turn it off when nothing on the application depends on it. Turning on a Product can generate usage-related costs. For more information, refer to Pricing.
A rule or a cache setting that needs a Product the application has off is refused when you save it, with one of the codes in Errors. For example, a request rule whose criterion reads ${request_uri} is refused while Application Accelerator is off, and the same rule on ${uri} is accepted. For the variables and behaviors each Product adds, refer to Rules Engine for Applications.
Tiered Cache has no toggle in the Modules section. It is a switch inside each cache setting. For more information, refer to Tiered Cache.
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 Debug Rules toggle sets it.
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 variable. A rule that is missing from that list did not run on the request.
For example, when a Set Cache Policy rule seems to have no effect on a path, the $traceback of a request to that path 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
Main Settings carries no delivery or protocol settings. Domains, protocols, and certificates belong to the workload that serves the application, and the Deployment Settings of the workload select the Application it runs.
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 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 | Status |
|---|---|---|
| Create an application | POST /workspace/applications | 202, with state set to pending |
| List the applications of the account | GET /workspace/applications | 200 |
| Read one application | GET /workspace/applications/<application-id> | 200 |
| Change part of an application | PATCH /workspace/applications/<application-id> | 202, with state set to pending |
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 three commands under the application noun. Each Product flag takes a string, such as true.
| Command | What it does |
|---|---|
azion create application | Creates an application. --cache and --image-processor set those Products at creation |
azion update application | Changes the application that --application-id names. --application-accelerator, --functions, and --image-processor turn a Product on or off |
azion describe application | Returns the application that --application-id names, with its modules object |
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 Products on, the object reads:
Errors
A Product that is off on the application surfaces as a refusal of the object that needs it, with 400. Each of these refusals names Application Accelerator. 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 or by query string, 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 Max Age to 60 seconds or more |