Connect On-Premises SQL Server to a Fabric Lakehouse: Gateway, Connection and Copy Pipeline Steps
By Mirko Peters · · Updated
Step by step: install the on-premises data gateway, create a SQL Server connection in Fabric, copy tables into a lakehouse with a pipeline or copy job, and the gateway, authentication and destination settings Microsoft documents.
To load an on-premises SQL Server database into a Fabric lakehouse you need three things: an on-premises data gateway that can reach the server, a connection in Fabric that uses that gateway, and a pipeline or copy job that writes to the lakehouse. This article lays out the steps and the settings Microsoft documents.
Key points
- Fabric pipelines need an on-premises data gateway of version 3000.214.2 or later and outbound access to *.frontend.clouddatahub.net.
- Create the connection under Manage connections and gateways, choose On-premises, and use Windows authentication, which is available only through a gateway.
- Copy data in a pipeline reads SQL Server as a source only. Copy job supports SQL Server as source and destination and several load modes.
- In the lakehouse destination, Tables is the managed area. Choose Append, Overwrite or Upsert as the table action.
- Local access to the gateway machine is not allowed in pipelines.
What you need first
From the Learn article on accessing on-premises data in Fabric Data Factory:
- An on-premises data gateway installed in your local network.
- Gateway version 3000.214.2 or later for Fabric pipelines.
- You sign in to the gateway with your user account, after which it is ready to use.
- A firewall rule that allows outbound connections to \*.frontend.clouddatahub.net from the gateway.
The article does not describe the database permissions the SQL Server login needs, so agree those with your DBA. A read-only login on the source tables is a sensible principle, but it is not stated in the pages I read.
Step 1: Create the connection
- In the Fabric portal, select the settings gear at the top right.
- Choose Manage connections and gateways.
- In New connection, select On-premises.
- Enter the gateway cluster, the resource type and the remaining details.
- Choose the authentication method. The page leaves the supported methods to the connector article.
The SQL Server connector overview lists these for pipelines: Basic, Organizational account, service principal and Windows. Windows authentication is only available through an on-premises gateway, so it is the relevant option here. Service principal authentication applies only to SQL Server on Azure VMs. The same table lists None, On-premises and Virtual network as gateway options for pipelines and copy jobs.
Step 2: Copy the data with a pipeline
- In your workspace, create a pipeline.
- On the Home tab select Copy data, then Use copy assistant.
- On Choose data source, add a new source and select the connection you created.
- Select the lakehouse as the destination.
- Select Run in the pipeline editor.
In pipelines, the SQL Server connector supports the copy activity as a source only, plus the Lookup, Get Metadata, Script and Stored procedure activities.
Alternative: Use a copy job
A copy job is also documented. Select New item and then Copy job. On Choose data source, go to New sources and select SQL Server. Enter the connection details, and the gateway connection is filled in automatically. Choose the destination, review the mapping and settings, then select Save + Run on Review + Save.
Copy job supports SQL Server as source and destination. Its load modes are full load, CDC, incremental load, append, override, upsert and CDC merge. If you need recurring incremental loads, review these modes before you build a pipeline by hand.
Step 3: Configure the lakehouse destination
The lakehouse destination page describes these settings:
Root folder. Choose Tables (managed) or Files (unmanaged).
For Tables:
- Table: pick an existing table or type a new name. In a schema-enabled lakehouse, use schema.table. Without a schema the service uses dbo.
- Table action: Append adds rows. Overwrite replaces data and schema, and earlier versions stay in the Delta log for time travel. Upsert inserts and updates, and needs one or more key columns.
- Partitioning (advanced): writes a folder structure such as year=2000/month=01. Supported partition column types are string, integer, boolean and datetime. Partition columns cannot overlap with key columns (the page notes this under Upsert).
- Apply V-Order (advanced): on by default.
For Files, you choose a path and a format such as Parquet, Delimited text, JSON or others. Copy behavior options apply when the source is file-based, which does not describe a SQL Server source.
Table name rules from the same page: at least one character, no slash or backslash, no trailing dot and no leading or trailing spaces. If source columns have special characters or spaces, use Delta column mapping with delta.columnMapping.mode set to name. The page says the service can auto-create such a table with column mapping mode name when the destination table does not exist, or when the table action is Overwrite.
Limits and gotchas
- Gateway machine access: local access to the machine with the gateway installed is not allowed in pipelines.
- Firewall: pipelines need outbound access to \*.frontend.clouddatahub.net. My own tip: a missing rule is an obvious first check when the run cannot start.
- Private link: for a workspace with a private link and an on-premises data gateway version 3000.286.12 or later, add \*.dfs.fabric.microsoft.com to the gateway's allow list so the connector can reach OneLake.
- Decimal source columns: editing the destination column type is not supported.
- Binary format: mapping is not supported.
A short test plan (my own suggestion, not from Learn)
- Create the connection and use the connection test in the dialog if available.
- Copy one small table to a new lakehouse table with Overwrite.
- Check the row count and column types in the lakehouse.
- Change to Append or Upsert for the production table, with key columns if needed.
- Schedule the pipeline only after a full run succeeds.
Common mistakes (my own list, derived from the pages above)
- Using an old gateway version that does not support pipelines.
- Choosing Service principal for an on-premises SQL Server.
- Forgetting the outbound firewall rule for the pipeline service.
- Writing to Files when you wanted a Delta table in Tables.
- Using Overwrite on a table that downstream reports read during the run.
What the pages I read do not cover
The pages do not walk through a virtual network data gateway setup for this scenario, although the connector overview and the copy job page list it as an option. They also do not cover the permissions of the SQL Server login or throughput tuning. Treat those as questions for the connector reference pages and your own tests.
Related
Sources
- Microsoft Learn: How to access on-premises data sources in Data Factory - Microsoft Fabric
- Microsoft Learn: SQL Server database connector overview
- Microsoft Learn: Configure lakehouse in a copy activity
- Microsoft Learn: What is Copy job in Data Factory
FAQ
Which gateway version do Fabric pipelines need?
According to Microsoft Learn, you need an on-premises data gateway version 3000.214.2 or later to support Fabric pipelines. The gateway machine must also allow outbound connections to *.frontend.clouddatahub.net.
Which authentication works for on-premises SQL Server?
The SQL Server connector overview lists Basic, Organizational account, Service principal and Windows authentication for pipelines. Windows authentication is only for the on-premises gateway, and the page says Service principal authentication only applies to SQL Server on Azure VMs.
Should I use a pipeline or a copy job?
Learn describes both. A pipeline copy activity supports SQL Server as a source only. A copy job supports SQL Server as source and destination, and its load modes include full load, incremental load, append, override, upsert and CDC. The copy job page calls Copy job the go-to solution for simplified data movement with no pipelines required and links a data movement strategy guide for comparison. The pages I read give no rule specific to SQL Server, so choose by the load mode you need.
What does Overwrite do to a lakehouse table?
Learn says Overwrite replaces the table's data and schema. Previous versions remain in the Delta log and can be read with Delta Lake time travel. Append adds rows, and Upsert inserts new rows and updates existing ones using key columns.