dbt-fabricspark

1.9.5 · active · verified Thu Apr 16

dbt-fabricspark is a Microsoft Fabric Spark adapter plugin for dbt (data build tool), enabling data analysts and engineers to transform data within Microsoft Fabric Lakehouses. It connects to Fabric Lakehouses via Livy endpoints, supports both schema-enabled and non-schema configurations, and includes Livy session management. The library is actively maintained by Microsoft and its current version is 1.9.5, typically aligning with dbt-core release cycles.

Common errors

Warnings

Install

Quickstart

The quickstart involves setting up your `profiles.yml` with the `fabricspark` adapter type, specifying your Fabric workspace, lakehouse, and authentication method (typically Azure CLI). After configuring, standard `dbt` CLI commands like `dbt run` will execute transformations on your Microsoft Fabric Lakehouse. Ensure you are logged in via `az login` for CLI authentication.

# 1. Ensure dbt-core and dbt-fabricspark are installed and Azure CLI is logged in.
# pip install dbt-core dbt-fabricspark
# az login

# 2. Configure your ~/.dbt/profiles.yml file (replace placeholders):
# fabricspark-dev:
#   target: dev
#   outputs:
#     dev:
#       type: fabricspark
#       method: livy
#       authentication: CLI
#       endpoint: https://api.fabric.microsoft.com/v1
#       workspaceid: <your-workspace-guid>
#       lakehouseid: <your-lakehouse-guid>
#       lakehouse: <your-lakehouse-name>
#       schema: <your-schema-name> # Optional, defaults to target schema, or lakehouse name for non-schema lakehouses
#       threads: 1
#       connect_retries: 2
#       connect_timeout: 10
#       retry_all: true # Recommended for production

# 3. Create a dbt project (if you don't have one):
# dbt init my_fabric_project

# 4. In your dbt project's dbt_project.yml, set the profile:
# name: 'my_fabric_project'
# profile: 'fabricspark-dev'

# 5. Create a sample model (e.g., models/my_first_model.sql):
# -- models/my_first_model.sql
# {{ config(materialized='table') }}
# SELECT
#   1 as id,
#   'dbt fabricspark test' as message

# 6. Run your dbt models:
# dbt run

# This command will connect to your Fabric Lakehouse via Spark Livy and execute the SQL.
print("dbt-fabricspark quickstart involves configuring profiles.yml and running dbt CLI commands.")
print("Authentication relies on an active Azure CLI login session.")

view raw JSON →