> For the complete documentation index, see [llms.txt](https://docs.soda.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soda.io/integrations/alation.md).

# Alation

{% hint style="info" %}
You will be prompted to [contact support](mailto:support@soda.io) as a last step to finish setting up the Alation integration.
{% endhint %}

Integrate Soda with Alation to access details about the quality of your data from within the data catalog.

* Run data quality checks using Soda and visualize quality metrics and rules within the context of a data source, dataset, or column in Alation.
* Use Soda Cloud to flag poor-quality data in lineage diagrams and during live querying.
* Give your Alation users the confidence of knowing that the data they are using is sound.

> 🎥 Watch a [5-minute overview](https://vimeo.com/563765014) showcasing the integration of Soda and Alation.

<figure><img src="/files/17dc36mxhFBeM9btYsYi" alt=""><figcaption><p>Alation dashboard when integrated with Soda</p></figcaption></figure>

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* You have verified some contracts and published the results to Soda Cloud.
* You have an Alation account with the privileges necessary to allow you to add a data source, create custom fields, and customize templates.
* You have a git repository in which to store the integration project files.

***

## Local setup <a href="#set-up-the-integration" id="set-up-the-integration"></a>

{% stepper %}
{% step %}

#### Credentials

**1.1. Log in to Soda Cloud**

Sign into your Soda Cloud account and confirm that you see the datasets you expect to see in the data source you wish to test for quality.

**1.2. Create an `.env` file**

To connect your Soda Cloud account to your Alation Service Account, create an `.env` file in your integration project in your git repo and include details according to the example below. Refer to [Generate API keys](https://docs.soda.io/soda-cloud/api-keys.html) to obtain the values for your Soda API keys.

{% code title=".env" %}

```dotenv
ALATION_HOST=yourcompany.alationcatalog.com
ALATION_USER=<your username for your Alation account>
ALATION_PASSWORD=<your password for your Alation account>
SODA_HOST=cloud.soda.io            ## or cloud.soda.us.io, depending on your organization
SODA_API_KEY_ID=<your Soda Cloud pubic key>
SODA_API_KEY_SECRET=<your Soda Cloud private key>
```

{% endcode %}

**Optional Configurations:**

* `SSL_VERIFY` - `True` / `False` - set whether ssl certificates should be verified (default `True`). Disabling ssl verify should only be used for POCs and temporarily, not for production.
* `SSL_VERIFY_PATH` - string, a path to local certificate to be used if custom/self-signed ssl certificates are used.
* `REFRESH_TOKEN_PATH` - string, storage path for the Alation refresh token
* `CONFIGURED_REFRESH_TOKEN_PATH` - string, path to a directory where the Alation refresh token is located. This is used to initially configure a Alation refresh token. The file in this path is copied into the `REFRESH_TOKEN_PATH`
* `SODA_DATASOURCE_MAPPING_FILE` - string, path with file name to the datasource mapping file
* `SODA_DESCRIPTION_ATTRIBUTE` - string, Soda check attribute name to use for the custom description fields in Alation
  {% endstep %}

{% step %}

#### Data source mappings

**Create a mapping file**

To sync a data source and schema in the Alation catalog to a data source in Soda Cloud, you must map it from Soda Cloud to Alation. Create a `.datasource-mapping.yml` file in your integration project and populate it with mapping data according to the following example. The table below describes where to retrieve the values for each field.

{% code title=".datasource-mapping.yml" %}

```yaml
 - name: Cars
   soda:
     datasource_id: 2d33bf0a-9a1c-4c4b-b148-b5af318761b3
     datasource_name: adventureworks
     # optional dataset_mapping   soda: catalog
     dataset_mapping:
        Cars_data: Cars
   catalog:
     type: "alation"
     datasource_id: "31"
     datasource_container_name: "soda"
     datasource_container_id: "1"
 - name: Soda Demo
   soda:
     datasource_id: 8505cbbd-d8b3-48a4-bad4-cfb0bec4c02f
   catalog:
     type: "alation"
     datasource_id: "37"
     datasource_container_name: "public"
     datasource_container_id: "2"
```

{% endcode %}

| Field                                                                    | Retrieve value from                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                                                                   | A name you choose as an identifier for an integration between Soda Cloud and a data catalog.                                                                                                                                                      |
| <p><code>soda:</code><br><code>datasource\_id</code></p>                 | The data source information panel in Soda Cloud.                                                                                                                                                                                                  |
| <p><code>soda:</code><br><code>datasource\_name</code></p>               | The data source information panel in Soda Cloud.                                                                                                                                                                                                  |
| <p><code>soda:</code><br><code>dataset\_mapping</code></p>               | <p>(Optional) When you run the integration, Soda automatically maps all of the datasets between data sources. However, if the names of the datasets differ in the tools you can use this property to manually map datasets between tools.<br></p> |
| <p><code>catalog:</code><br><code>type:</code></p>                       | The name of the cataloging software; in this case, “alation”.                                                                                                                                                                                     |
| <p><code>catalog:</code><br><code>datasource\_id</code></p>              | Retrieve this value from the URL on the data source page in the Alation catalog; see image below.                                                                                                                                                 |
| <p><code>catalog:</code><br><code>datasource\_container\_name</code></p> | The schema of the data source; retrieve this value from the data source page in the Alation catalog under the subheading **Schemas**. See image below.                                                                                            |
| <p><code>catalog:</code><br><code>datasource\_container\_id</code></p>   | The ID of the `datasource_container_name` (the schema of the data source); retrieve this value from the schema page in the Alation catalog. See image below                                                                                       |

* Retrieve the Alation `datasource_id` from the URL<br>

  <figure><img src="/files/1P1dUpgeO1rKHilnKR6f" alt=""><figcaption><p>The <code>datasource_id</code> is in the URL of the data source page</p></figcaption></figure>
* Retrieve the Alation `datasource_container_name` (schema) from the data source page<br>

  <figure><img src="/files/Dqz2haoR3KyiWtlLZYEO" alt=""><figcaption><p>The <code>datasource_container_name</code> is the data source schema name</p></figcaption></figure>
* Retrieve the Alation `datasource_container_id` for the `datasource_container_name` from the URL in the **Schema** page.\ <br>

  <figure><img src="/files/1zOtQkMvbh2Uhi9tPApl" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

#### Onboarded datasets

Make sure that datasets you wish to sync data quality data from Soda Cloud to catalog are fully onboarded on both sides.
{% endstep %}

{% step %}

#### \[Optional] Enable API access to Alation with SSO

If your Alation account employs **single sign-on (SSO)** access, you must [Create an API service account](https://developer.alation.com/dev/docs/creating-an-api-service-account) for Soda to integrate with Alation.

If your Alation account **does not use SSO**, skip this step and proceed to [Customize the catalog](https://docs.soda.io/soda/integrate-alation.html#customize-the-catalog).
{% endstep %}

{% step %}

#### Customize the catalog

{% hint style="info" %}
Some catalogs require manual customization for this integration to work.
{% endhint %}

Alation custom fields are created in global context on Alation -> Settings -> Customize Catalog -> Custom Fields page. These fields can then be attached to any entity on Custom Templates tab on the same page.

Set up the following custom fields and then attach them to the Table entity:

* `Has DQ` - Picker with `True` and `False` values (!) Make sure to use these values exactly as Alation API is case-sensitive.
* `Profile - Last Run` - Date
* `Soda DQ Overview` - Rich Text

**6.1. Custom fields**

Create custom fields in Alation that reference information that Soda Cloud pushes to the catalog. These are the fields the catalog users will see that will display Soda Cloud data quality details.\
In your Alation account, navigate to **Settings** > **Catalog Admin** > **Customize Catalog**. In the **Custom Fields** tab, create the following fields:

* Under the **Pickers** heading, create a field for “Has DQ” with Options “True” and “False”. The Alation API is case sensitive so be sure to use these exact values.
* Under the **Dates** heading, create a field for “Profile - Last Run”.
* Under the **Rich Texts** heading, create the following fields:
  * “Soda DQ Overview”
  * “Soda Data Quality Rules”
  * “Data Quality Metrics”

**6.2. Add custom fields to Custom Templates**

Add each new custom field to a **Custom Template** in Alation. In **Customize Catalog**, in the **Custom Templates** tab, select the **Table** template, then click **Insert…** to add a custom field to the template:

* “Soda DQ Overview”

**6.3. Add "Data Quality Info" grouping**

In the **Table** template, click **Insert…** to add a **Grouping of Custom Fields**. Label the grouping “Data Quality Info”, then **Insert…** two custom fields:

* “Has DQ”
* “Profile - Last Run”

1. In the **Column** template, click **Insert…** to add a custom field to the template:
   * “Has DQ”

**6.4. Add "Soda Data Profile Information" grouping**

**6.4.** In the **Column** template, click **Insert…** to add a **Grouping of Custom Fields**. Label the grouping “Soda Data Profile Information”, then **Insert…** two custom fields:

* Data Quality Metrics
* Soda Data Quality Rules
  {% endstep %}
  {% endstepper %}

## Kubernetes setup <a href="#run-the-integration" id="run-the-integration"></a>

The Soda-Alation integration can be run in a Kubernetes cluster. Contact <support@soda.io> to run the integration in your organization.

***

## Run the integration <a href="#run-the-integration" id="run-the-integration"></a>

Contact <support@soda.io> directly to acquire the assets and instructions to run the integration and view Soda Cloud details in your Alation catalog.

***

## Use the integration <a href="#use-the-integration" id="use-the-integration"></a>

Access Soda Cloud to [create no-code checks](/data-testing/cloud-managed-data-contracts.md) or [initiate a request](/data-testing/contract-collaboration.md#initiate-a-request) in order to **execute checks against datasets** in your data source each time you run a Soda scan manually or orchestrate a scan using a data pipeline tool, such as Airflow. Soda Cloud **pushes data quality scan results** to the corresponding data source in Alation so that users can **review data quality information from within the catalog**.

In Alation, beyond reviewing data quality information for the data source, users can access the **Joins** and **Lineage** tabs of individual datasets to examine details and investigate the source of any data quality issues.

#### Open in Soda <a href="#open-in-soda" id="open-in-soda"></a>

In a dataset page in Alation, in the **Overview** tab, users have the opportunity to review Soda information on Alation, or directly access Soda Cloud to scrutinize data quality details.

<figure><img src="/files/oK8q8e2LQkBTMWp8uPzo" alt=""><figcaption><p>Under the <strong>Soda DQ Overview</strong> heading in Alation, click <strong>Open in Soda</strong> to access the dataset page in Soda Cloud</p></figcaption></figure>

***

{% if visitor.claims.plan === 'datasetStandard' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Dataset Standard license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if visitor.claims.plan === 'enterprise' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Team license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if visitor.claims.plan === 'enterpriseUserBased' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Enterprise license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if !(visitor.claims.plan === 'enterprise' || visitor.claims.plan === 'enterpriseUserBased' || visitor.claims.plan === 'datasetStandard') %}
{% hint style="info" %}
You are **not logged in to Soda** and are viewing the default public documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).

If you do have a Soda license, make sure to **log in to Soda Cloud in this same browser**.
{% endhint %}
{% endif %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.soda.io/integrations/alation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
