# How to Install Add Request ID from Marketplace

The Azion **Add Request ID** integration enables you to add an additional header in the incoming request object, assigning a unique identifier to each HTTP request attended by Azion Web Platform.

This identifier facilitates you in tracking and identifying individual requests, as well as allows you to analyze logs and identify issues. This way, you can cross-reference data from observability products, such as Azion Data Stream and Real-Time Events, with the internal logs of your infrastructure.

---

## Getting the integration

To install Azion **Add Request ID**:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace's homepage, select the integration's card.
3. Once the integration page opens, click the **Install** button.

A success message appears to confirm that your integration is installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar. 
:::

---

## Configuring the integration

### Setting up a firewall

To do so, follow the steps:

1. On the upper-left corner, select **Products menu** > **Firewall** in the **Secure** section.
2. Click the **+ Firewall** button.
3. Give an easy-to-remember name to your firewall.
4. Enable the **Functions** switch in the **Modules** section.
5. Click the **Save** button.

Done. Now you've instantiated the firewall for your integration and it has access to functions.

:::caution[Warning]
If a product or module is activated, it could generate usage-related costs, such as function execution. Check the [pricing page](/en/documentation/products/pricing/) for more information.
:::

### Setting up the function

While still on the **Firewall** page:

1. Select the **Functions Instances** tab.
2. Click the **+ Function Instance** button.
3. Choose an easy-to-remember name for your function.
4. On the dropdown menu, select the **Add Request ID** function.
    - This action will load the **Arguments** tab.

In this case, the **Add Request ID** function can be used without any arguments. However, it has a single optional argument that can be used to modify the name of the header where the Request ID will be inserted.

| JSON Args key |Environment Variable Name | Data Type | Default Value | Description |
| ----------- | ----------- | ----------- | ----------- | ----------- |
| `header_name` | `AZION_REQUEST_ID_HEADER_NAME` | String | `x-azn-request-id` | The name of the header where the function will insert the Request ID.  If the argument isn't a non-empty string, then the function will use the default value |

:::note
JSON Args have priority over environment variables. If both artifacts have value, the function will use whatever is defined in the JSON Args.
:::

5. When you're done, click the **Save** button.

### Setting up the Rules Engine

To finish, you have to set up a **Rules Engine** to configure the *criteria* and the *behavior* to run the function.

Still in the **Firewall** page:

1. Select the **Rules Engine** tab.
2. Click the **+ Rule Engine** button.
3. Give a name to the rule.
4. Select a *criteria* to run and catch the domains that you want to run the integration on.
  - Example: if `Host` *matches* `yourdomain.com`.
5. Below, select a *behavior* to the *criteria*. In this case, it'll be **Run Function**. 
    - Select the adequate function according to the name you gave it during the instantiation step.
6. Click the **Save** button.

On the Console, you must now configure your domain so your firewall protects it.

7. On the **Products menu**, select **Workloads**.
8. Click on the domain you want to protect with your Add Request ID function.
9. In the **Settings** section, click on the `Firewall` selector and choose the firewall you created.
10. Click the **Save** button.

Done. You've now configured the **Add Request ID** integration and will start receiving the header.

---