> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Synapse

> Create a source to monitor data from Azure Synapse.

Connect Validio to Azure Synapse to monitor data quality across your serverless and dedicated SQL pools.

## Prerequisites for adding an Azure Synapse source

Azure Synapse is an analytics service built on SQL Server, with two options: serverless (on-demand) SQL pool and dedicated SQL pool.

To connect to Azure Synapse, you need existing Microsoft Entra ID or Microsoft SQL Server accounts. These accounts need to have the permissions listed in the following table to access databases, schemas, and tables within your Synapse workspace. For more information, see [Synapse Database Objects](#synapse-database-objects) and [Microsoft Azure documentation](https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/sql-authentication).

> [!WARNING]
>
> **Credential Permission Requirements**
>
> Validio Credentials **require** `VIEWER` access rights when connecting to sources to read and access data. Admins must ensure that they do not provide `EDITOR` access rights to their credentials.

| Authorization Type | Permissions Needed | Synapse with Server-less SQL Pool (On-demand) | Synapse with Dedicated SQL Pool |
| :- | :- | :- | :- |
| Microsoft Entra ID | Synapse SQL Administrator Synapse Administrator Storage Blob Data Reader <sup>1</sup> | All Validio features (Some limitations with Lineage and Catalog <sup>2</sup>) | All Validio features |
| Microsoft SQL Server | On all databases: SELECT VIEW DATABASE STATE VIEW DEFINITION | All Validio features (Some limitations with Lineage and Catalog <sup>2</sup>) | All Validio features (Without VIEW DATABASE STATE permissions, no Lineage) |

<sup>1</sup> The Storage Blob Data Reader permission is needed on the blob storage services containing external tables. Microsoft SQL Server credentials (login and password) cannot feature or read data from external tables.

<sup>2</sup> For authorization with Microsoft Entra ID for Synapse workspaces on a server-less pool, you will be able to view all catalog assets in Lineage (as nodes) and table-view relationships (as edges), but not table-table relationships (as edges). Also, the utilization metrics in Catalog will only show the count of reads, because writes are handled outside of the Synapse (updating the files in the blog store).

## Add Azure Synapse credentials

To monitor Azure Synapse Analytics in Validio, add valid credentials for either Microsoft Entra ID or Microsoft SQL Server. Refer to the following credential parameters tables. For more information, see [About Credentials](https://docs.validio.io/docs/credentials.md).

> [!TIP]
>
> **Synapse Workspace on Server-less Pool**
>
> For Synapse workspaces on a server-less pool, the Microsoft SQL Server account may not have access to the data. We recommend creating your credential with Microsoft Entra ID authorization.

To add a credential for Azure Synapse,

1. Navigate to **Credentials** and click **+ New credential**.
2. Under **Namespace**, select a namespace where the resources will be created.
3. For **Credential Type**, select **Microsoft Entra ID Credential** or **Microsoft SQL Server Credential**.
4. Fill in the **Configuration** parameters for the credential. Refer to the relevant credential parameters table.
5. (Optional) Click **Test credential** to validate that Validio can successfully access the configured account. If validation fails, check that you provided the correct parameter values.
6. (Optional) Check **Use for catalog and schema checks** to automatically discover assets from this credential and add them to the Catalog page.
7. Click **Create credential**.

Validio will automatically start fetching data and you will be able to view Azure Synapse assets and their relationships in the Catalog (if selected) and Lineage pages.

Once the credential is created, you can add a source to monitor Azure Synapse data.

### Microsoft Entra ID credential parameters

| Field | Description |
| :- | :- |
| Credential Type | Azure Synapse Entra ID Credential |
| Name | Identifier for the credentials. Used when accessing sources. |
| Client ID | Application (client) ID which you can find in your Azure Portal. |
| Client Secret | Client secret value for your application, which you can find in your Azure Portal. |
| Host | DNS hostname or IP address to the database server. |
| Port | Port number of the database server. |
| Database | (Optional) Name of the Azure Synapse database. |
| Azure Synapse Backend | (Optional) Specify whether the backed is a Serverless SQL Pool or Dedicated SQL Pool. |

### Microsoft SQL Server credential parameters

| Field | Description |
| :- | :- |
| Credential Type | Azure Synapse SQL Credential |
| Name | Identifier for the credentials. Used when accessing sources. |
| Username | SQL Server username. |
| Password | SQL Server password. |
| Host | DNS hostname or IP address to the SQL server. |
| Port | Port number of the SQL server. |
| Database | (Optional) Name of the Azure Synapse database. |
| Azure Synapse Backend | (Optional) Specify whether the backed is a Serverless SQL Pool or Dedicated SQL Pool. |

## Add an Azure Synapse source

To add a source for **Azure Synapse**,

1. Navigate to **Sources** and click **+ New source**.
2. Under Source type, select **Azure Synapse**.
3. Under **Config**,
   1. Select the valid **Credential** or create a new credential to authenticate your connection to the data warehouse.
   2. 1. You have two options for specifying the dataset and tables to monitor:
         1. **Select an existing table** -- Enter the **Database**, **Schema**, and **Table** to specify where the data comes from. Selecting more than one table will create a new source for each table. Refer to the [Source Configuration Parameters](#source-configuration-parameters) table.
         2. **Use Custom SQL** -- Write a valid SQL query to specify the tables to monitor.
   3. Set the **Polling schedule**, which is how frequently the validators on the source will check for changes.
4. Under **Schema**, click **Continue** to automatically infer the schema fields from the tables you selected. If you select many tables, this operation can take a few minutes to complete.
5. Under **Source details**,
   1. Add **Tags** to help group related sources or to use for routing notifications.
   2. Add an **Owner** who will be the contact for incident notifications.
   3. Assign a **Priority**, which indicates the importance of incidents detected on this source.
6. Click **Continue** to create the source.
   Source names are generated automatically and  will be displayed when the source creation completes. If there are more than 5 sources, you will see the names for the first five and a count of the remaining sources.

### Source configuration parameters

| Field | Description |
| :- | :- |
| Database | Name of the Azure Synapse database. |
| Schema | Name of the schema that contains the table to access. |
| Table | Name of the table to read data from. |

## Synapse database objects

Validio queries specific database objects to populate Catalog and Lineage pages after the source is added.

> **Catalog**
>
> * `sys.databases`
> * `sys.schemas`
> * `sys.objects`
> * `sys.tables`
> * `sys.columns`
> * `sys.extended_properties`
> * `sys.types`
> * `INFORMATION_SCHEMA.TABLES`

> **Lineage**
>
> * `sys.dm_exec_requests_history`
> * `sys.dm_pdw_exec_requests`
> * `sys.dm_pdw_exec_sessions`
