How to create an External Table in a Microsoft Fabric Warehouse: step by step
This tutorial shows how to create an External Table in a Microsoft Fabric Warehouse to query data stored in a Lakehouse without copying the files. Creating an External Table is useful to keep data centralized in OneLake/Lakehouse and have fast T-SQL access from a Warehouse.
Prerequisites
- An account with access to a workspace in Microsoft Fabric and permissions to create Warehouses and access a Lakehouse.
- A Lakehouse with a table or file (for example, parquet) already uploaded.
- Basic T-SQL knowledge in the context of the Microsoft Fabric Warehouse.
Step 1: Confirm the Lakehouse path and the file format
We need to know the path (shortcuts or OneLake path) where the files or the table are in the Lakehouse. In the Fabric Hub, open the Lakehouse, locate the table or file and copy the directory path or the table name. Also confirm the format (parquet, csv, delta).
Step 2: Open the Warehouse and create a new T-SQL query
Open the Warehouse where you intend to create the External Table. In the Warehouse, use a new T-SQL query to create the external table definition. The syntax uses CREATE EXTERNAL TABLE with the LOCATION specification pointing to the Lakehouse path (Direct Lake/OneLake). Here is a minimal example for Parquet files.
CREATE EXTERNAL TABLE dbo.ExternalSales
(
OrderID bigint,
CustomerID varchar(50),
OrderDate datetime2,
Amount decimal(18,2)
)
WITH (
LOCATION = 'OneLake:////Lakehouse//sales/',
DATA_SOURCE = 'FabricDirectLake',
FILE_FORMAT = 'Parquet'
);
Notes: DATA_SOURCE can be an existing logical name; if it does not exist, create it in the next step. LOCATION must be the correct path to the file/parquet in the Lakehouse.
Step 3: Create an EXTERNAL DATA SOURCE (if necessary)
If your Warehouse does not have a DATA_SOURCE that points to OneLake/Direct Lake, create it. This allows the Warehouse to understand how to access the Lakehouse.
CREATE EXTERNAL DATA SOURCE FabricDirectLake
WITH (
LOCATION = 'OneLake:///',
TYPE = HADOOP
);
Replace <TenantName> with your identifier. TYPE = HADOOP is the common option for connecting to OneLake/Direct Lake in the Warehouse context.
Step 4: Create a FILE FORMAT (if necessary)
If you need to define the file format (for example CSV with a specific delimiter), create a FILE FORMAT. For Parquet it is usually not required, but for CSV it is important.
CREATE EXTERNAL FILE FORMAT CsvFormat
WITH (
FORMAT_TYPE = DELIMITEDTEXT,
FORMAT_OPTIONS (
FIELD_TERMINATOR = ',',
STRING_DELIMITER = '"',
FIRST_ROW = 1
)
);
Step 5: Create the External Table pointing to a Delta table
For Delta Lake (common in Lakehouse), the LOCATION points to the Delta folder. Use FILE_FORMAT = 'Delta' or adjust as needed.
CREATE EXTERNAL TABLE dbo.ExternalDeltaOrders
(
OrderID bigint,
Status varchar(50),
ModifiedAt datetime2
)
WITH (
LOCATION = 'OneLake:////Lakehouse/delta/orders/',
DATA_SOURCE = 'FabricDirectLake',
FILE_FORMAT = 'Delta'
);
Step 6: Test queries and handle common errors
After creating the External Table run simple SELECTs. Common errors: insufficient permissions (403/401), incorrect path, or misconfigured DATA_SOURCE. For permissions, confirm the role in the Lakehouse and in the workspace; for path, check capitalization and folder names.
SELECT TOP (100) *
FROM dbo.ExternalSales
ORDER BY OrderDate DESC;
If you receive a format error, try creating/adjusting the EXTERNAL FILE FORMAT. If performance is slow, check partitions in the Lakehouse and whether the file is in parquet/Delta.
Verify the result
Confirm that the query returns rows and that data types are correct. Also check in the Warehouse pane that the External Table appears in the objects list. For additional tests, compare counts between the External Table and the original source in the Lakehouse:
SELECT COUNT(*) AS CountWarehouse FROM dbo.ExternalSales;
-- compare with the count in the Lakehouse (e.g., open the table in the Lakehouse UI)
Conclusion
Creating an External Table in a Microsoft Fabric Warehouse allows querying Lakehouse data without duplicating it, maintaining governance and performance depending on the format (Parquet/Delta). Recommended next steps: test partitions, create T-SQL views over the External Table and monitor egress costs. Tip: if you encounter permission errors, confirm the integration between the workspace and OneLake and your user roles.