KBAISE/ for lovable
Library
Docs

Connect your app to Microsoft Fabric

about 15 minBuildingchecked 2h agoOfficial page
The short version

Connect your Lovable app to Microsoft Fabric to query your data from Lakehouses, Warehouses, and SQL databases. This lets your app read and write data using a single connection without needing to manage different database drivers.

Anyone building an app that needs to access data stored in Microsoft Fabric, especially if they want to combine data from different sources like Lakehouses and SQL databases.

Do this, in order

  1. 1

    Go to the Microsoft Entra admin center and register a new application, or use an existing one.

    This creates a 'service principal' which is like a digital identity for your Lovable app to use when talking to Microsoft Fabric.

  2. 2

    From your registered application's 'Overview' page, copy the 'Directory (tenant) ID' and the 'Application (client) ID'.

    These are unique identifiers for your Microsoft account and your app, which Lovable will need to make the connection.

  3. 3

    Create a new client secret for your application under 'Certificates & secrets' and immediately copy its 'value'.

    This secret acts like a password for your app, allowing Lovable to securely authenticate with Microsoft Fabric. Microsoft only shows it once, so copy it right away.

  4. 4

    Ask a Fabric tenant admin to enable 'Service principals can call Fabric public APIs' in the Admin portal under 'Tenant settings → Developer settings'.

    This setting allows your app's digital identity (service principal) to communicate with Fabric's public APIs, which is essential for the connection to work.

  5. 5

    In your Fabric workspace, create or open an 'API for GraphQL' item and add the data sources (like Lakehouses or Warehouses) your app needs to access.

    This item acts as a central point where you define what data from your various Fabric sources will be exposed through a single GraphQL endpoint for your app.

  6. 6

    Grant your service principal 'Run Queries and Mutations' permissions on the 'API for GraphQL' item in your Fabric workspace.

    This gives your app the necessary access rights to read and potentially change data through the GraphQL API.

  7. 7

    Ask a Fabric workspace admin to enable 'Introspection' in the 'API for GraphQL' item's 'API settings'.

    Introspection allows Lovable to understand the structure of your data in Fabric, which is crucial for building your app. Without it, the connection will fail.

  8. 8

    Copy the public GraphQL endpoint URL from your 'API for GraphQL' item in Fabric.

    This is the specific web address Lovable will use to send requests to your Fabric data.

  9. 9

    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.

  10. 10

    Enter a display name for your connection, then paste the 'Microsoft Entra Tenant ID', 'Service Principal Client ID', 'Client Secret', and 'Fabric GraphQL Endpoint' you copied earlier.

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

  11. 11

    Choose who in your Lovable workspace can use this connection (Only you, Invite specific people, or Invite entire workspace).

    This controls access to the Fabric data through this connection for other people working in your Lovable project.

  12. 12

    Click 'Connect'.

    Lovable will test the connection immediately to ensure everything is set up correctly, allowing you to start building your app.

Paste this into your project

I need to connect my Lovable app to Microsoft Fabric. I've already set up my service principal in Microsoft Entra and prepared my API for GraphQL item in Fabric. Here are the details:

Microsoft Entra Tenant ID: [Your Directory (tenant) ID]
Service Principal Client ID: [Your Application (client) ID]
Client Secret: [Your client secret value]
Fabric GraphQL Endpoint: [Your Fabric GraphQL endpoint URL, ending in /graphql]

Can you guide me through the steps to add this connection in Lovable and link it to my project?

Words decoded

Microsoft Fabric
Microsoft's all-in-one platform for managing and analyzing large amounts of data, combining tools like data warehouses, data lakes, and business intelligence.
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 many different sources, often used for business reporting and decision-making.
SQL database
A common type of database that stores data in tables and uses a special language (SQL) to manage and query that data.
Mirrored databases
Copies of databases from other services (like Snowflake or Azure SQL) that are made available within Microsoft Fabric, allowing you to query them as if they were native Fabric data.
API for GraphQL
A specific feature within Microsoft Fabric that lets you access your data using GraphQL, a flexible way to ask for exactly the data you need from a server.
GraphQL
A way for your app to ask for data from a server. Instead of getting a fixed set of information, your app can specify exactly what data it needs, making it very efficient.
Microsoft Entra service principal
A special type of user account in Microsoft's identity system (formerly Azure Active Directory) that represents an application or service, rather than a human user. It allows your app to securely access resources.
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).
OAuth2 client credentials
A secure method for an application to get access to protected resources by presenting its own identity (client ID and secret) to an authorization server, without needing a user to log in.
GraphQL mutations
In GraphQL, these are operations used to change data on the server, such as creating new records, updating existing ones, or deleting them.
Introspection
A GraphQL feature that allows a client (like Lovable) to ask a GraphQL server (like Fabric's API for GraphQL) about the types of data and operations it supports. It's like asking the server for its own instruction manual.
Fabric capacity
The computing power and resources allocated to your Microsoft Fabric workspace, which determines the performance and capabilities of your Fabric services.
F SKU
A specific type of license or pricing tier for Microsoft Fabric that provides dedicated capacity.
Power BI Premium P SKU
A high-end license for Microsoft Power BI that includes dedicated capacity and advanced features, which can also be used to enable Fabric.

Where people get stuck

  • Forgetting to enable 'Introspection' in your Fabric '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 result in access denied errors.
  • Failing to enable 'Service principals can call Fabric public APIs' in Fabric's tenant settings will cause Fabric to reject all requests from your app.
  • Not copying the client secret value immediately after creation, as Microsoft only displays it once.
  • Using an incorrect 'Fabric GraphQL Endpoint' URL, especially if it doesn't end with '/graphql'.
  • Trying to write data to a Fabric Warehouse table that doesn't have a primary key defined, as mutations won't be generated for it.
  • Expecting to query data sources not supported by Fabric's 'API for GraphQL' (e.g., Real-Time Intelligence stores).
  • Assuming per-user access control; this connector uses a shared service principal, so all users of the app access data with the same permissions. Use the 'app user connector' for individual user logins.

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.