KBAISE/ for lovable
Library
Docs

Connect your app to Microsoft Fabric

about 15 minBuildingchecked 2d agoOfficial page
The short version

You can connect your Lovable app to Microsoft Fabric to work with data from Lakehouses, Warehouses, SQL databases, and mirrored databases. This lets your app query, and sometimes change, your data through a single connection.

Anyone building an app that needs to access data stored in Microsoft Fabric.

Do this, in order

  1. 1

    Make sure you have a Microsoft Fabric workspace with a Fabric capacity, an API for GraphQL item set up with your data, and a Microsoft Entra service principal with a client secret.

    These are the foundational pieces required by Microsoft Fabric to allow external applications like Lovable to connect and access your data securely.

  2. 2

    Ask a Fabric tenant admin to enable 'Service principals can call Fabric public APIs' in the Admin portal and ensure 'Users can create Fabric items' is enabled if you still need to create the API for GraphQL item.

    These settings are crucial permissions within Fabric that allow your service principal to interact with the API for GraphQL item.

  3. 3

    In the Microsoft Entra admin center, register an application, note its Directory (tenant) ID and Application (client) ID, and create a client secret, copying its value immediately.

    This creates the identity (service principal) that Lovable will use to authenticate with Microsoft Fabric, and these IDs and the secret are its credentials.

  4. 4

    In your Fabric workspace, create or open an API for GraphQL item, add the data you want to use (e.g., Lakehouses, Warehouses), and grant your service principal 'Run Queries and Mutations' access.

    The API for GraphQL item is the specific gateway through which Lovable will access your data, and the service principal needs explicit permission to interact with it.

  5. 5

    In the API for GraphQL item's settings, enable 'Introspection' (a Fabric workspace admin can do this) and then copy the public GraphQL endpoint URL.

    Introspection allows Lovable to understand the structure of your data, which is essential for building your app, and the endpoint URL is the address Lovable uses to talk to your Fabric data.

  6. 6

    In Lovable, go to 'Connectors', select 'Microsoft Fabric', and click 'Add connection'.

    This starts the process of setting up the connection within your Lovable project.

  7. 7

    Enter a display name for your connection, then paste the Microsoft Entra Tenant ID, Service Principal Client ID, Client Secret, and Fabric GraphQL Endpoint URL into the respective fields.

    These are the credentials and address Lovable needs to establish a secure and functional connection to your Microsoft Fabric data.

  8. 8

    Choose who can use this connection by adjusting the 'Sharing' settings, then click 'Connect'.

    This determines whether the connection is private to you or accessible to other members of your Lovable workspace, and 'Connect' finalizes the setup and tests the connection.

Paste this into your project

Connect my app to Microsoft Fabric. I have my Microsoft Entra Tenant ID, Service Principal Client ID, Client Secret, and the Fabric GraphQL Endpoint URL ready. I've also set up my API for GraphQL item with introspection enabled and granted the service principal permissions.

Words decoded

Microsoft Fabric
Microsoft's all-in-one platform for managing and analyzing large amounts of data, combining various data tools like data warehouses and data lakes.
Lakehouse
A modern data storage system that combines the best features of data lakes (for raw, unstructured data) and data warehouses (for structured, analyzed data).
Warehouse
A large database system designed for storing and analyzing historical data from various sources, typically used for business intelligence and reporting.
SQL database
A type of database that stores and manages data using Structured Query Language (SQL), which is a standard language for interacting with databases.
Mirrored database
A copy of an existing database (like Snowflake or Azure SQL) that is kept in sync with the original, allowing you to access its data within Microsoft Fabric without moving it.
API for GraphQL
A specific feature within Microsoft Fabric that creates a single, flexible way for apps to ask for exactly the data they need from your Fabric data sources, using a query language called GraphQL.
GraphQL
A way for apps to ask for data from a server. Instead of getting a fixed set of data, the app can specify exactly what information it needs, making data retrieval more efficient.
Microsoft Entra service principal
A special identity (like a user account, but for an application) in Microsoft's identity system that allows apps to securely access resources and services without needing a human user to sign in.
Client secret
A password-like string of characters used by an application (like your Lovable app) to prove its identity when authenticating with a service like Microsoft Fabric.
Introspection
A feature of GraphQL that allows an application to ask the server what types of data it can provide and how that data is structured. Lovable uses this to understand your Fabric data.
Tenant ID
A unique identifier for your organization's account within Microsoft's cloud services, like Microsoft Entra.
Client ID
A unique identifier for a specific application registered within your Microsoft Entra account.
Mutation
In GraphQL, a type of operation used to change data on the server, such as creating, updating, or deleting records, or calling a stored procedure.
Stored procedure
A set of SQL commands stored in a database that can be executed as a single unit, often used for complex operations or to enforce business logic.

Where people get stuck

  • Forgetting to enable 'Introspection' in your API for GraphQL item will prevent the connection from working.
  • Not granting the service principal 'Run Queries and Mutations' permissions on the API for GraphQL item will lead to access errors.
  • Failing to enable 'Service principals can call Fabric public APIs' in the Fabric Admin portal will cause all requests from the service principal to be rejected.
  • Using a Microsoft Fabric workspace that is not backed by a Fabric capacity (like Power BI Pro or PPU workspaces) will prevent you from creating an API for GraphQL item.
  • Not copying the client secret value immediately after creation, as Microsoft only shows it once.
  • Entering an incorrect Fabric GraphQL Endpoint URL, especially if it doesn't end with '/graphql'.
  • Expecting write operations (create, update, delete) to work on Warehouse tables without a primary key defined, or on Lakehouses and mirrored sources which are read-only.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.