This sample project demonstrates how to combine Microsoft Fabric Lakehouse, DuckDB's DuckLake for storage, and SQLMesh for data orchestration.
- Python: 3.10 or newer
- Azure CLI: Install instructions
- AzCopy: Install instructions
DuckLake tables (from your Postgres database) are synchronized as Delta tables in the Lakehouse Tables directory.
This enables seamless consumption by Power BI reports using Direct Lake mode.
-
Resource Group
Create a resource group to contain all resources. -
Azure Key Vault
Used to store secrets (service principal credentials, database passwords, etc). -
Azure Database for PostgreSQL Flexible Server
Minimum tier is sufficient. -
Microsoft Fabric Workspace
- Create a workspace.
- Add a schema-enabled Lakehouse.
-
Azure Service Principal
- Create a service principal.
- Assign it as a Contributor to the Fabric workspace.
git clone https://github.com/mrjsj/fabric-ducklake-sqlmeshpython -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Copy
.env.exampleto.envand fill in all required values:
cp .env.example .env
# Edit .env with your editor of choice- Open
fabric/SQLMeshRunner.ipynband update the Configuration section:- Key vault, workspace, lakehouse, and database names
- Ensure all secret names match those in your Key Vault
- Add all secrets referenced in the notebook to your Azure Key Vault.
- Upload
fabric/SQLMeshRunner.ipynbto your Fabric workspace. - Attach the Lakehouse as the default lakehouse for the notebook.
make planFirst authenticate and Upload Code
make azcopy-loginmake azcopy-uploadOpen the Fabric Notebook in the specified workspace and click "Run all".
make azcopy-remove