How to create a Synapse Link to a Lakehouse in Microsoft Fabric
This tutorial teaches how to configure a Synapse Link to move data from a Warehouse to a Lakehouse in Microsoft Fabric, useful for making data available for ETL/Power BI and reducing latency. I explain why this is useful and provide a practical step-by-step with result verification.
Prerequisites
- Microsoft account with access to Microsoft Fabric and permissions to create Warehouse and Lakehouse in the same tenant.
- Workspace with an existing Warehouse that contains a sample table.
- OneLake with write permissions to the directory where the Lakehouse will reside.
- Basic knowledge of SQL and the Microsoft Fabric portal.
Step 1: Understand what a Synapse Link is
A Synapse Link in Microsoft Fabric allows replicating data from a Warehouse to a Lakehouse continuously (or via scheduled synchronizations), creating a copy optimized for analysis with Spark/Delta and ensuring consistency. It is useful when you want to transform/share data without affecting Warehouse performance.
Step 2: Prepare the table in the Warehouse
Confirm that the table in the Warehouse has a primary key or timestamp column to allow incremental replication. If necessary, create a view or table with the fields you want to replicate.
-- Exemplo: criar tabela de exemplo no Warehouse (T-SQL) CREATE TABLE vendas_fabric ( id INT PRIMARY KEY, data_venda DATETIME2, produto NVARCHAR(100), valor DECIMAL(10,2) ); -- Inserir registo de exemplo INSERT INTO vendas_fabric VALUES (1, GETUTCDATE(), 'Exemplo', 99.90);
Step 3: Create the Lakehouse or choose an existing one
Open the Microsoft Fabric portal, go to OneLake and create a new Lakehouse (or use an existing one). Note the path/URI of the Lakehouse where the Delta files will be written.
Step 4: Create the Synapse Link on the Warehouse
In the Fabric portal, access the Warehouse that contains the table. Look for the option to create a Synapse Link (it may be under integrations/external). Define the source (table) and the destination (Lakehouse/OneLake path). Choose whether synchronization is continuous or scheduled.
-- Exemplo conceptual: comando para criar Link (a interface gráfica efectua estes passos). -- Passos na UI: -- 1. Warehouse > Integrações/External links > New Synapse Link -- 2. Selecionar tabela 'vendas_fabric' -- 3. Destination: Lakehouse -> path: /OneLake/Workspace/Lakehouses/analise/vendas_delta -- 4. Definir modo: Incremental by data_venda ou Full sync (consoante necessidade) -- 5. Criar e iniciar
Step 5: Configure mapping and schema
Check the column mapping between source and destination. Confirm types (for example DATETIME2 to timestamp in Delta). If necessary, adjust the Lakehouse definition to accept the types or create a Delta target table with the desired schema.
-- Exemplo: criar Delta table na Lakehouse (Spark SQL no Fabric Notebook ou Query Editor) CREATE TABLE IF NOT EXISTS delta.`/OneLake/Workspace/Lakehouses/analise/vendas_delta` USING DELTA AS SELECT id, data_venda, produto, valor FROM parquet.`/tmp/placeholder`; -- Nota: a primeira escrita da Synapse Link irá materializar os ficheiros Delta reais.
Step 6: Start synchronization and monitor
After creating the Synapse Link, start the synchronization. Use the Warehouse logs/monitoring to track progress. Check for transformation errors or permissions when writing to OneLake.
Verify the result
Confirm that the Delta files appeared in the Lakehouse: open the Lakehouse in the Fabric portal and check the new table/files. Run a simple query in the Lakehouse to validate the replicated data.
-- Exemplo: consultar dados replicados (Spark SQL) SELECT * FROM delta.`/OneLake/Workspace/Lakehouses/analise/vendas_delta` LIMIT 10;
If the query returns the expected records (for example the record with id = 1), the Synapse Link is working. For common issues: check OneLake permissions, incompatible schema, or missing key columns.
Conclusion
You now have a Synapse Link replicating data from the Warehouse to the Lakehouse, enabling analyses with Spark and integration with Power BI without overloading the Warehouse. Next steps: automate transformations with Delta Live Tables or create Power BI reports pointing to the Lakehouse. Tip: always validate types and permissions before creating the Link to avoid write errors.