> For the complete documentation index, see [llms.txt](https://docs.telm.ai/telmai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.telm.ai/telmai/connect-to-data/data-connections/microsoft-fabric.md).

# Microsoft Fabric SQL

Connect Telmai to a Microsoft Fabric warehouse or lakehouse SQL analytics endpoint.

Telmai reads tables from a [Microsoft Fabric](https://learn.microsoft.com/en-us/fabric/fundamentals/microsoft-fabric-overview) **Warehouse** or **Lakehouse** over its SQL analytics endpoint. Fabric accepts Microsoft Entra authentication only, so Telmai signs in as a service principal or, on Azure deployments, as a [managed identity](https://docs.telm.ai/telmai/connect-to-data/data-connections/sql-server-managed-identity.md). To read OneLake files directly instead, see [Azure OneLake](https://docs.telm.ai/telmai/connect-to-data/data-connections/azure-onelake.md).

## Before you connect

1. For the **Service Principal** scheme, [register an application in Microsoft Entra](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) and note its **Application (client) ID**, a **Client secret** from **Certificates & secrets**, and the **Directory (tenant) ID** of the tenant that owns the Fabric workspace. For the **Managed Identity (connection)** scheme, set up the identity as described in [Azure Managed Identity Authentication](https://docs.telm.ai/telmai/connect-to-data/data-connections/sql-server-managed-identity.md).
2. Grant the service principal or managed identity read access to the warehouse or lakehouse.
3. Open the warehouse or lakehouse in the Fabric portal and copy two GUIDs from the address bar: the **Workspace ID** (`.../groups/<workspaceId>/...`) and the item's **Warehouse / Lakehouse ID**.

If Fabric must allow Telmai through a firewall, allowlist the addresses in [IP Allowlist](https://docs.telm.ai/telmai/api-reference/telmai-ip-list.md).

{% hint style="warning" %}
A Fabric tenant administrator must turn on **Service principals can use Fabric APIs**, which also covers managed identities. Otherwise the connection test fails with `401` or `403`. If your tenant can't turn it on, see [Limitations](#limitations).
{% endhint %}

## Connection fields

On the **Connections** page, click **Add connection** and choose **Microsoft Fabric SQL**. See [Add a connection](https://docs.telm.ai/telmai/connect-to-data.md#add-a-connection) for the full flow.

| Field                                         | Description                                                                                 |
| --------------------------------------------- | ------------------------------------------------------------------------------------------- |
| **Schema**                                    | The schema to connect to, for example `dbo`.                                                |
| **Authentication Scheme**                     | **Service Principal** (default), or **Managed Identity (connection)** on Azure deployments. |
| **Managed Identity**                          | The registered identity to authenticate as.                                                 |
| **Microsoft Entra Tenant ID**                 | Directory (tenant) ID of the Entra tenant that owns the Fabric workspace.                   |
| **Workspace ID**                              | Workspace GUID from the Fabric portal URL.                                                  |
| **Item Type**                                 | **Warehouse** (default) or **Lakehouse**.                                                   |
| **Warehouse / Lakehouse ID**                  | Item GUID of the warehouse or lakehouse from the Fabric portal URL.                         |
| **SQL connection string (optional override)** | Leave empty. Telmai finds the endpoint from the workspace and item IDs.                     |
| **Client ID**                                 | Application (client) ID of the service principal.                                           |
| **Client Secret**                             | Client secret of the service principal.                                                     |

**Managed Identity** appears only for the **Managed Identity (connection)** scheme. **Microsoft Entra Tenant ID**, **Client ID** and **Client Secret** appear only for **Service Principal**. There are no server, port or database fields.

## Asset fields

Click **Add assets** on the connection. See [Add assets](https://docs.telm.ai/telmai/connect-to-data.md#list-of-connectors-enabled-by-default).

| Field               | Description                                                                                                                                                                            |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection mode** | **Existing table** to pick tables or views, or **Custom query** to define the asset with SQL. See [Connection Modes](https://docs.telm.ai/telmai/connect-to-data/connection-modes.md). |

**Metadata only** scans are supported. See [Scan depth](https://docs.telm.ai/telmai/connect-to-data/configuring-a-data-source.md#scan-depth).

## Limitations

* **Tenants that block service principals.** Paste the host from the item's **Settings > SQL connection string** into **SQL connection string (optional override)**. Telmai then skips the Fabric API and uses **Warehouse / Lakehouse ID** as the database name. A warehouse GUID works, but a lakehouse only accepts its display name: with the override, enter the lakehouse's display name instead of its GUID.
* **Long scans with a managed identity.** A managed-identity token lasts about an hour, so a long-running or heavily queued scan can fail. Use **Service Principal** for those assets.
