# Applications first steps

Before using **Applications**, make sure you have:

- An Azion Console account. You can find more information about how to create your account on the [documentation page](/en/documentation/products/accounts/creating-account/).
- An application. If you haven't created an application yet, check the [build an application](/en/documentation/products/guides/build/build-an-application/) page.

> See also the guides on [how to clone](/en/documentation/products/guides/clone-applications/) and [how to delete](/en/documentation/products/guides/delete-applications/) an application.

## Main Settings

To access the main settings and configure your application:

1. [Access Azion Console](https://console.azion.com).
2. On the upper-left corner of the page, open the **Products menu**, represented by three horizontal lines, and then select **Applications**.
3. Select the application you want to configure.

You're now in the page to configure the general delivery settings of your application. 

### Applications Modules

**Applications** offers the following modules:

- [Application Accelerator](/en/documentation/products/build/applications/application-accelerator/)
- [Cache](/en/documentation/products/build/applications/cache/)
- [Functions](/en/documentation/products/build/applications/functions/)
- [Image Processor](/en/documentation/products/build/applications/image-processor/)
- [Tiered Cache](/en/documentation/products/build/applications/cache/tiered-cache/)

Some **Applications modules** are billed products and it may generate usage-related costs. Check the [Applications modules pricing](/en/documentation/products/pricing/) for more information.

To enable a module in your application:

1. [Access Console](https://console.azion.com).
2. On the upper-left corner of the page, select **Products Menu** > **Applications**.
3. Select the application.
4. In the **Main Settings** tab, under the **Modules** section, activate the desired module.
5. Click the **Save** button.

## Advanced settings

Other than the **Main Settings** tab, you'll see several other tabs:

- [Device Groups](/en/documentation/products/build/applications/device-groups/)
- [Cache Settings](/en/documentation/products/build/applications/cache-settings/)
- [Functions](/en/documentation/products/build/applications/functions-instances/)
- [Rules Engine](/en/documentation/products/build/applications/rules-engine/)

Each tab stores in other configuration options for your application.

### Configuring Your Backend (Origin) Connection

A backend, also known as an origin, is the server from which Azion retrieves your content. This can include object storage services, cloud servers, or other infrastructure that hosts your application assets or data.

To configure your application's origin you'll use [Connectors](/en/documentation/products/secure/connectors/).

1. [Access Console](https://console.azion.com).
2. On the upper-left corner of the page, select **Products Menu** > **Connectors**.
3. Create an Connector by clicking the **\+ Connector** button.
4. In the field **Connector Type**, select the desired Connector Type.
5. Fill in the remaining fields.
6. Click the **Save** button.

:::note
For more details on Connector Types, please visit the [Connectors reference](/en/documentation/products/secure/connectors/).
:::

To activate an Connector:

1. Access the **Rules Engine** tab.
2. Edit the default rule or add a new request phase rule.
3. In the **Criteria** section, to apply the origin for your whole application, set the criteria to **If `${uri}` starts with `/`**.
4. In the **Behavior** section, select the **Set Connector** behavior.
5. Select the Connector you want to apply.
6. Click the **Save** button.

**Connector** enables you to configure multiple origins and distribute traffic among them by using [Load Balancer](/en/documentation/products/secure/connectors/load-balancer/).

:::tip
You can use [Custom Pages](/en/documentation/products/secure/custom-pages/) to configure custom error pages that are displayed when **Connector** receives specific error responses (such as HTTP 4xx or 5xx status codes) from your origin.
:::

### Device Groups

Manage devices using [Device Groups](/en/documentation/products/build/applications/device-groups/):

1. Access the **Device Groups** tab.
2. Click the **Add Device Group** button.
3. Name your device group.
4. Add what contents the `User-Agent` header should contain in regex format following PCRE standard.
5. Click the **Save** button.

To apply **Adaptive Delivery** to a device group:

1. Access the **Cache Settings** tab.
2. Select the cache setting from the list or add a new one.
3. In **Adaptive Delivery**, select the option **Content varies by some Device Groups (Whitelist)**.
4. Click the **+ Device Group** button.
5. Select the device group from the list.
6. Click the **Save** button.

The `${device_group}` variable will also be available in **Rules Engine**:

1. In the **Main Settings** tab of your application, activate the **Application Accelerator** module.
2. Access the **Rules Engine** tab.
3. Edit the default rule or add a new request rule.
4. In the **Criteria** section, select the `${device_group}` variable.
5. Select the comparison operator **is equal to** and type the name of the device group in the argument field.
6. Set the desired behavior.
7. Click the **Save** button.

### Cache Settings

Edit your cache configuration in [Cache Settings](/en/documentation/products/build/applications/cache-settings/):

1. Access the **Cache Settings** tab.
2. Click the **Add Cache Settings** button.
3. Enter an easy to remember name for your cache setting. For example: `/target-uri - Cache TTL`.
4. In the **Expiration Settings**, you can customize your cache's TTL as follows:
   - Under **Browser Cache Settings**, select **Override Cache Settings** to define how long your content can be cached in browsers.
   - Under **CDN Cache Settings**, select **Override Cache Settings** to define how long your content can be cached at the edge.
5. If you've chosen to override cache settings, add the desired **Maximum TTL** in seconds.
    - At this point, you may also customize other cache settings for dynamic content provided by the [Advanced Cache Key](/en/documentation/products/build/applications/cache-settings/#advanced-cache-key) feature.
6. Click the **Save** button.

#### Tiered Cache

To use the [Tiered Cache](/en/documentation/products/build/applications/cache/tiered-cache/) module:

1. In the **Main Settings** tab, at the end of the **Applications Modules** section, enable the **Tiered Cache** switch.
2. Access the **Cache Settings** tab.
3. To manage the tiered cache layer settings, click the **Add Cache Settings** button to create a new cache settings, or select one of the existing ones from the **Cache Settings List** to edit it.
4. Set the **Default TTL (seconds)** field to a value greater than or equal to *3 seconds*.
5. Enable the **Tiered Cache** switch.
6. Click the **Save** button.

### Functions

Instantiate your functions using [Functions](/en/documentation/products/build/applications/functions-instances/):

1. In the **Main Settings** tab, activate the **Functions** module.
2. In the **Functions** tab, click **Add function** to instantiate the desired function.
3. Access the **Args** tab and fill in the required information.
4. Click the **Save** button.

To activate a function:

1. Access the **Rules Engine** tab.
2. Add a rule in any of the available phases.
3. Set the desired criteria.
4. In the **Behavior** section, choose the **Run Function** behavior.
5. Select the instantiated function from the list.
6. Click the **Save** button.

### Rules Engine

Create conditional business rules for your application using [Rules Engine](/en/documentation/products/build/applications/rules-engine/).

> Some variables and behaviors require you to activate the **Application Accelerator**.

1. Access the **Rules Engine** tab.
2. Click the **Add Rule** button.
3. Select either the **Request Phase** or **Response Phase**.
4. Name your rule.
5. Add an optional description for your rule.
6. In the **Criteria** section, you can determine the conditions that will trigger the desired behavior.
7. In the **Behaviors** section, define what happens should the criteria be met.
8. Click the **Save** button.

## Real-Time Purge

To access [Real-Time Purge](/en/documentation/products/build/applications/real-time-purge/), proceed as follows:

1. [Access Console](https://console.azion.com).
2. On the upper-left corner of the page, select **Products Menu** > **Real-Time Purge**.
3. Click the **New Purge** button and fill in the required fields.
4. Click the **Purge** button to perform a purge for the chosen options.