Telemetry — MANDATORY. Every api.fabric.microsoft.com call must carry
x-ms-fabric-skill: databricks-migration (az rest: --headers "x-ms-fabric-skill=databricks-migration"),
including every LRO poll, fabric_lro and retry. Snippets omit it — add it anyway.
CRITICAL NOTES
- To find workspace details (including its ID) from a workspace name: list all workspaces, then use JMESPath filtering
- To find item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace, then use JMESPath filtering
dbutils.widgets has no direct equivalent in Fabric — use notebook parameters (cell tag parameters); notebookutils.runtime.context is execution metadata, not parameter storage. If showing context fields, use documented names such as currentWorkspaceId, currentWorkspaceName, currentNotebookId, currentNotebookName, isForPipeline, and isForInteractive; activityId is the Livy job ID
dbutils.library (runtime library install) has no equivalent — use Fabric Environments for reproducible library management
- Unity Catalog uses a 3-level namespace (
catalog.schema.table); Fabric Lakehouse uses 2-level (schema.table within a named Lakehouse)
- For an under-specified workspace-wide migration, ask focused questions about inventory, workload topology, security, data locations, and runtime constraints before recommending a Fabric topology
- A completed Fabric migration must not retain executable
dbutils.* calls in dual-runtime branches or try/except guards — replace the calls and Databricks paths outright
Databricks → Microsoft Fabric Migration
Prerequisite Knowledge
Read these companion documents before executing migration tasks:
- COMMON-CORE.md — Fabric REST API patterns, authentication, token audiences, item discovery
- COMMON-CLI.md —
az rest, az login, token acquisition, Fabric REST via CLI
- SPARK-AUTHORING-CORE.md — Notebook deployment, lakehouse creation, Spark job execution
For notebook and Lakehouse creation, see spark-cli.
For Fabric Warehouse DDL/DML authoring, see sqldw-cli.
Table of Contents
Migration Workload Map
| Databricks Component |
Fabric Target |
Notes |
| All-purpose cluster (notebooks, REPL) |
Fabric Notebook (Starter Pool or Custom Pool) |
No persistent cluster — Fabric provisions compute on session start |
| Job cluster (automated jobs) |
Spark Job Definition (SJD) |
SJD maps one-to-one with Databricks Jobs on job clusters |
| Unity Catalog |
Fabric Lakehouse (schema per namespace) |
See catalog-migration.md |
| Databricks Repos (Git-backed notebooks) |
Fabric Git Integration |
Connect workspace to Azure DevOps or GitHub; notebooks are synced |
| Delta Live Tables (DLT) |
Fabric Notebooks + Data Pipelines |
No DLT equivalent — rewrite DLT datasets as parameterized notebook cells with pipeline orchestration |
| Databricks SQL Warehouses |
Fabric Warehouse or Lakehouse SQL Endpoint |
SQL warehouse sessions → Warehouse (for write) or SQL Endpoint (for read-only) |
| MLflow Tracking |
Fabric ML Experiments |
MLflow SDK is supported in Fabric — see § MLflow |
| Delta Sharing |
OneLake Shortcuts + Fabric external data sharing |
See § Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts |
| Databricks Feature Store |
Fabric Feature Store (preview) |
Direct conceptual equivalent; APIs differ |
| dbutils (all sub-modules) |
notebookutils (most sub-modules) |
See dbutils-to-notebookutils.md for full mapping |
dbutils → notebookutils Quick Reference
The complete side-by-side API table is in dbutils-to-notebookutils.md. The key mappings are:
dbutils Call |
notebookutils Equivalent |
Compatibility Note |
dbutils.fs.ls(path) |
notebookutils.fs.ls(path) |
Direct replacement |
dbutils.fs.cp(src, dest) |
notebookutils.fs.cp(src, dest) |
Direct replacement |
dbutils.fs.mv(src, dest) |
notebookutils.fs.mv(src, dest, create_path, overwrite=False) |
⚠️ Signature differs — see dbutils-to-notebookutils.md |
dbutils.fs.rm(path, recurse) |
notebookutils.fs.rm(path, recurse) |
Direct replacement |
dbutils.fs.mkdirs(path) |
notebookutils.fs.mkdirs(path) |
Direct replacement |
dbutils.fs.put(path, contents) |
notebookutils.fs.put(path, contents) |
Direct replacement |
dbutils.fs.head(path, maxBytes) |
notebookutils.fs.head(path, max_bytes) |
⚠️ Default differs — Python/Scala 100 KB, R 64 KB. See dbutils-to-notebookutils.md |
dbutils.fs.mount(...) |
notebookutils.fs.mount(source, mountPoint, extraConfigs=None) |
✅ Supported — Microsoft Entra (default), accountKey, or sasToken auth. For cross-workspace / persistent sharing, prefer OneLake Shortcuts |
dbutils.secrets.get(scope, key) |
notebookutils.credentials.getSecret(keyVaultUrl, secretName) |
Scope → Key Vault URL; key → secret name |
dbutils.notebook.run(path, timeout, args) |
notebookutils.notebook.run(name, timeout, args) |
path → notebook name (relative to workspace) |
dbutils.notebook.exit(value) |
notebookutils.notebook.exit(value) |
Direct replacement |
dbutils.widgets.get(name) |
See § Widgets Migration |
No direct equivalent |
dbutils.library.install(...) |
Not available at runtime — use Fabric Environments |
dbutils.library.restartPython() → notebookutils.session.restartPython() |
dbutils.data.summarize(df) |
display(df.summary()) |
Use display() or pandas describe() |
Widgets Migration
dbutils.widgets has no direct equivalent in Fabric. Use these patterns instead:
| Use Case |
Fabric Pattern |
| Pass parameter from parent notebook |
Mark a cell in the child notebook as a parameters cell (notebook UI: cell "..." menu → "Mark cell as parameters"). The parent calls notebookutils.notebook.run("child", arguments={"param": "value"}) — at runtime the engine inserts a new cell beneath the parameters cell that overrides the defaults |
| Pipeline-driven parameterization |
Same parameters-cell mechanism; the Fabric Pipeline notebook activity supplies override values via its Base parameters setting |
| Centralized cross-notebook config |
Use notebookutils.variableLibrary.getLibrary("<name>") to read values from a Variable Library item (deployment pipelines activate the right value set per stage) |
| Interactive selection in notebook |
Use display() with input cells, IPython widgets (Python only), or Fabric Data Activator |
Note: notebookutils.runtime.context does not expose parameter values. It's for execution metadata (workspace/notebook/activity/user IDs, pipeline-vs-interactive flags, etc.). See dbutils-to-notebookutils.md § Runtime Context.
Cluster Config → Fabric Spark Pools
| Databricks Cluster Concept |
Fabric Spark Equivalent |
Notes |
| All-purpose cluster (interactive) |
Starter Pool |
Auto-provisioned; no config; ideal for notebooks |
| Job cluster (single-use for jobs) |
Custom Pool (or Starter Pool) attached to SJD |
Configure node size, autoscale in Fabric capacity settings |
Node type (e.g., Standard_DS3_v2) |
Fabric node size (Small/Medium/Large/X-Large/XX-Large) |
Map by vCore/memory ratio |
| Autoscale min/max workers |
Custom Pool min/max node settings |
Available in workspace Spark settings |
spark.conf in cluster settings |
Fabric Environment Spark properties |
Move to Environment item; attach to workspace or notebook |
init_scripts (cluster init) |
Fabric Environment install script |
Not fully equivalent — only library installs are supported |
| Databricks Runtime version |
Fabric Runtime (1.1 = Spark 3.3, 1.2 = Spark 3.4, 1.3 = Spark 3.5) |
Choose matching Spark version; test deprecated APIs |
| Photon accelerator |
Fabric Native Execution Engine (NEE) |
Enable in workspace Spark settings; vectorized execution similar to Photon |
Databricks Jobs → Spark Job Definitions
| Databricks Jobs Concept |
Fabric SJD Equivalent |
Notes |
| Job with single notebook task |
SJD referencing a notebook |
Attach a default Lakehouse; pass parameters via SJD args |
| Multi-task job (DAG of tasks) |
Fabric Data Pipeline orchestrating multiple SJDs/notebooks |
Pipeline activities map to job tasks; dependencies = activity dependencies |
| Job schedule (cron) |
Pipeline schedule trigger |
Cron expression → recurrence trigger in pipeline |
| Job parameters |
SJD default arguments or notebook cell parameters |
Parameters cell in notebook is injected at runtime |
| Job clusters per task |
Pool attached to SJD |
Each SJD can specify its Spark pool independently |
| Databricks Workflows |
Fabric Data Pipelines |
Full DAG orchestration with conditions, loops, and failure branches |
Delegate to spark-cli for SJD creation and notebook deployment.
Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts
| Databricks Delta Sharing Pattern |
Fabric Equivalent |
| Provider publishes a Delta share |
Fabric external data sharing for cross-tenant Fabric data, or a OneLake Shortcut to ADLS Gen2 where the Delta data resides |
| Recipient reads shared data |
Accept the external data share into a Lakehouse (Fabric creates a read-only OneLake Shortcut), or create a direct OneLake Shortcut to accessible ADLS Gen2 data |
| Cross-workspace table sharing within org |
OneLake Shortcuts pointing to another workspace's Lakehouse tables — no data copy |
| Cross-tenant sharing |
Fabric external data sharing — live, read-only, in-place access through a shortcut in the recipient tenant |
When producing a migration workload map, include both paths: direct OneLake Shortcuts for accessible ADLS or same-tenant OneLake data, and Fabric external data sharing for native cross-tenant recipient sharing.
MLflow → Fabric ML Experiments
Fabric ML Experiments are built on the MLflow SDK — most code is directly portable:
| Databricks MLflow Pattern |
Fabric Equivalent |
Migration Action |
mlflow.set_tracking_uri("databricks") |
Remove — Fabric tracking is automatic |
Delete this line in Fabric notebooks |
mlflow.set_experiment("/path/exp") |
mlflow.set_experiment("experiment_name") |
Use name only (not path); Fabric creates the Experiment item |
mlflow.log_metric(...) |
mlflow.log_metric(...) — identical |
No change |
mlflow.log_artifact(...) |
mlflow.log_artifact(...) — identical |
No change |
mlflow.autolog() |
mlflow.autolog() — identical |
No change |
mlflow.register_model(...) |
mlflow.register_model(...) — identical |
Model Registry is available in Fabric ML |
| Databricks Model Serving |
Azure ML Online Endpoints or Fabric Data Activator |
No direct Fabric model serving yet — use Azure ML |
Must / Prefer / Avoid
MUST DO
- Inventory before prescribing a workspace topology — for workspace-wide requests that omit workload inventory, dependencies, security requirements, data locations, or runtime constraints, ask focused clarifying questions and present conditional choices before selecting a Fabric design
- Replace all
dbutils.* calls using the mapping in dbutils-to-notebookutils.md — dbutils is not available in Fabric notebooks
- Migrate
dbutils.fs.mount() to notebookutils.fs.mount() (✅ supported — Microsoft Entra default, or accountKey / sasToken from Key Vault). For cross-workspace or persistent sharing, prefer OneLake Shortcuts instead. Always pair mount() with unmount() in try/finally — Fabric mounts are not released automatically on session end
- Replace
dbutils.secrets.get(scope, key) with notebookutils.credentials.getSecret(keyVaultUrl, secretName) — secret scopes map to Azure Key Vault URLs
- Redesign widget-based parameter passing using notebook parameters cells (cell "..." menu → "Mark cell as parameters"); use
notebookutils.variableLibrary for centralized cross-notebook config. notebookutils.runtime.context does not expose parameter values
- Replace
dbutils.library.install*() with Fabric Environments — runtime library installs are not supported in production. dbutils.library.restartPython() maps to notebookutils.session.restartPython() (Python / PySpark only)
- Adapt Unity Catalog 3-level namespaces (
catalog.schema.table) to Fabric 2-level (schema.table within a Lakehouse) — see catalog-migration.md
- Map Databricks cluster init scripts to Fabric Environments — cluster-level library installs must move to Environment items
PREFER
- Fabric Native Execution Engine (NEE) as the Photon equivalent — enable in workspace Spark settings for vectorized execution on Delta Lake
- OneLake Shortcuts over data copy for Delta tables that already exist in ADLS Gen2 — point directly without re-ingesting
- Fabric Git Integration as the replacement for Databricks Repos — connect workspace to ADO or GitHub for notebook version control
- Fabric ML Experiments for direct MLflow continuity — tracking code requires minimal changes (remove
set_tracking_uri)
- Medallion architecture when restructuring migrated Databricks catalogs — align
bronze, silver, gold Unity Catalog schemas to separate Fabric Lakehouses
- Starter Pool for migrating interactive notebook workflows — eliminates cluster startup time that was a common pain point in Databricks job clusters
AVOID
- Do not prescribe a one-size-fits-all workspace topology when the source inventory and migration constraints are missing
- Do not import
dbutils or attempt dbutils = ... assignments in Fabric notebooks — import attempts fail with ModuleNotFoundError, while unresolved dbutils references raise NameError; always use notebookutils
- Do not retain
dbutils.* calls behind runtime-detection guards (try/except, if IS_DATABRICKS) — replace the calls and Databricks paths outright with notebookutils and Fabric paths
- Do not assume Unity Catalog governance policies transfer automatically — RBAC, row-level security, and column masking must be reconfigured in Fabric using workspace roles and Lakehouse permissions
- Do not use
%pip install in production Fabric notebooks at runtime — use Fabric Environments for stable, versioned library management
- Do not attempt to port Delta Live Tables (DLT) pipelines verbatim — DLT has no Fabric equivalent; rewrite as parameterized notebooks orchestrated by Fabric Pipelines
- Do not rely on Databricks-specific Spark configurations (e.g.,
spark.databricks.*) — these are proprietary and will be silently ignored or raise errors in Fabric
- Do not use DBFS paths (
dbfs:/...) — there is no DBFS in Fabric; all paths must use OneLake abfss:// or Lakehouse-relative paths
Examples
See dbutils-to-notebookutils.md and code-patterns.md for the full mapping. Key quick references:
dbutils.fs → notebookutils.fs
# Databricks
dbutils.fs.ls("/mnt/bronze/orders/")
dbutils.fs.cp("/mnt/raw/file.csv", "/mnt/archive/file.csv")
# Fabric (replace DBFS/mount paths with OneLake relative paths)
notebookutils.fs.ls("Files/bronze/orders/")
notebookutils.fs.cp("Files/raw/file.csv", "Files/archive/file.csv")
dbutils.secrets → notebookutils.credentials
# Databricks
pwd = dbutils.secrets.get(scope="prod", key="db-password")
# Fabric (scope → Key Vault URL, key → secret name)
pwd = notebookutils.credentials.getSecret("https://myvault.vault.azure.net/", "db-password")
Unity Catalog namespace → Lakehouse schema
# Databricks
df = spark.read.table("prod.silver.customers")
# Fabric (catalog dropped; Lakehouse context provides it)
df = spark.read.table("silver.customers")
1---2name: databricks-migration3description: Port Databricks notebooks and jobs to Microsoft Fabric. Provides an exhaustive dbutils to notebookutils substitution table: fs operations (runtime mounts or OneLake Shortcuts), secret scope to Key Vault URL conversion, notebook run and exit, widget replacement with parameter-tagged cells, and library install replacement with Fabric Environments. Covers Unity Catalog three-level namespace reduction to Lakehouse two-level schemas, DBFS path conversion to OneLake, Databricks Jobs to Spark Job Definitions, MLflow tracking URI removal, and Photon to Native Execution Engine substitution. Use when the user wants to: (1) replace dbutils with notebookutils, (2) collapse Unity Catalog namespaces to Lakehouse schemas, (3) convert Databricks Jobs or Delta Live Tables. Triggers: "migrate from databricks", "databricks to fabric", "dbutils to notebookutils", "dbutils fabric", "unity catalog migration", "dbfs to onelake", "databricks notebook migration", "delta live tables fabric", "photon native execution".4---56> **Telemetry — MANDATORY.** Every `api.fabric.microsoft.com` call must carry7> `x-ms-fabric-skill: databricks-migration` (`az rest`: `--headers "x-ms-fabric-skill=databricks-migration"`),8> including every LRO poll, `fabric_lro` and retry. Snippets omit it — add it anyway.910> **CRITICAL NOTES**11> 1. To find workspace details (including its ID) from a workspace name: list all workspaces, then use JMESPath filtering12> 2. To find item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace, then use JMESPath filtering13> 3. `dbutils.widgets` has **no direct equivalent** in Fabric — use notebook parameters (cell tag `parameters`); `notebookutils.runtime.context` is execution metadata, not parameter storage. If showing context fields, use documented names such as `currentWorkspaceId`, `currentWorkspaceName`, `currentNotebookId`, `currentNotebookName`, `isForPipeline`, and `isForInteractive`; `activityId` is the Livy job ID14> 4. `dbutils.library` (runtime library install) has **no equivalent** — use Fabric Environments for reproducible library management15> 5. Unity Catalog uses a 3-level namespace (`catalog.schema.table`); Fabric Lakehouse uses 2-level (`schema.table` within a named Lakehouse)16> 6. For an under-specified workspace-wide migration, ask focused questions about inventory, workload topology, security, data locations, and runtime constraints before recommending a Fabric topology17> 7. A completed Fabric migration must not retain executable `dbutils.*` calls in dual-runtime branches or `try/except` guards — replace the calls and Databricks paths outright1819# Databricks → Microsoft Fabric Migration2021## Prerequisite Knowledge2223Read these companion documents before executing migration tasks:2425- [COMMON-CORE.md](../../common/COMMON-CORE.md) — Fabric REST API patterns, authentication, token audiences, item discovery26- [COMMON-CLI.md](../../common/COMMON-CLI.md) — `az rest`, `az login`, token acquisition, Fabric REST via CLI27- [SPARK-AUTHORING-CORE.md](../../common/SPARK-AUTHORING-CORE.md) — Notebook deployment, lakehouse creation, Spark job execution2829For notebook and Lakehouse creation, see [spark-cli](../spark-cli/SKILL.md).30For Fabric Warehouse DDL/DML authoring, see [sqldw-cli](../sqldw-cli/SKILL.md).3132---3334## Table of Contents3536| Topic | Reference |37|---|---|38| Migration Workload Map | [§ Migration Workload Map](#migration-workload-map) |39| Complete `dbutils` → `notebookutils` Mapping | [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) |40| Unity Catalog → Fabric Lakehouse Schemas | [catalog-migration.md](resources/catalog-migration.md) |41| Before/After Code Patterns | [code-patterns.md](resources/code-patterns.md) |42| Cluster Config → Fabric Spark Pools | [§ Cluster Config → Fabric Spark Pools](#cluster-config--fabric-spark-pools) |43| Databricks Jobs → Spark Job Definitions | [§ Databricks Jobs → Spark Job Definitions](#databricks-jobs--spark-job-definitions) |44| Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts | [§ Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts](#delta-sharing--fabric-external-data-sharing-and-onelake-shortcuts) |45| MLflow → Fabric ML Experiments | [§ MLflow → Fabric ML Experiments](#mlflow--fabric-ml-experiments) |46| Must / Prefer / Avoid | [§ Must / Prefer / Avoid](#must--prefer--avoid) |47| Authentication & Token Acquisition | [COMMON-CORE.md § Authentication](../../common/COMMON-CORE.md#authentication--token-acquisition) |48| Lakehouse Management | [SPARK-AUTHORING-CORE.md § Lakehouse Management](../../common/SPARK-AUTHORING-CORE.md#lakehouse-management) |49| Notebook Management | [SPARK-AUTHORING-CORE.md § Notebook Management](../../common/SPARK-AUTHORING-CORE.md#notebook-management) |5051---5253## Migration Workload Map5455| Databricks Component | Fabric Target | Notes |56|---|---|---|57| **All-purpose cluster** (notebooks, REPL) | Fabric Notebook (Starter Pool or Custom Pool) | No persistent cluster — Fabric provisions compute on session start |58| **Job cluster** (automated jobs) | **Spark Job Definition (SJD)** | SJD maps one-to-one with Databricks Jobs on job clusters |59| **Unity Catalog** | **Fabric Lakehouse** (schema per namespace) | See [catalog-migration.md](resources/catalog-migration.md) |60| **Databricks Repos** (Git-backed notebooks) | **Fabric Git Integration** | Connect workspace to Azure DevOps or GitHub; notebooks are synced |61| **Delta Live Tables (DLT)** | **Fabric Notebooks** + **Data Pipelines** | No DLT equivalent — rewrite DLT datasets as parameterized notebook cells with pipeline orchestration |62| **Databricks SQL Warehouses** | **Fabric Warehouse** or **Lakehouse SQL Endpoint** | SQL warehouse sessions → Warehouse (for write) or SQL Endpoint (for read-only) |63| **MLflow Tracking** | **Fabric ML Experiments** | MLflow SDK is supported in Fabric — see [§ MLflow](#mlflow--fabric-ml-experiments) |64| **Delta Sharing** | **OneLake Shortcuts** + **Fabric external data sharing** | See [§ Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts](#delta-sharing--fabric-external-data-sharing-and-onelake-shortcuts) |65| **Databricks Feature Store** | **Fabric Feature Store** (preview) | Direct conceptual equivalent; APIs differ |66| **dbutils** (all sub-modules) | **`notebookutils`** (most sub-modules) | See [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) for full mapping |6768---6970## `dbutils` → `notebookutils` Quick Reference7172The complete side-by-side API table is in [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md). The key mappings are:7374| `dbutils` Call | `notebookutils` Equivalent | Compatibility Note |75|---|---|---|76| `dbutils.fs.ls(path)` | `notebookutils.fs.ls(path)` | **Direct replacement** |77| `dbutils.fs.cp(src, dest)` | `notebookutils.fs.cp(src, dest)` | **Direct replacement** |78| `dbutils.fs.mv(src, dest)` | `notebookutils.fs.mv(src, dest, create_path, overwrite=False)` | ⚠️ Signature differs — see [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) |79| `dbutils.fs.rm(path, recurse)` | `notebookutils.fs.rm(path, recurse)` | **Direct replacement** |80| `dbutils.fs.mkdirs(path)` | `notebookutils.fs.mkdirs(path)` | **Direct replacement** |81| `dbutils.fs.put(path, contents)` | `notebookutils.fs.put(path, contents)` | **Direct replacement** |82| `dbutils.fs.head(path, maxBytes)` | `notebookutils.fs.head(path, max_bytes)` | ⚠️ Default differs — Python/Scala 100 KB, R 64 KB. See [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) |83| `dbutils.fs.mount(...)` | `notebookutils.fs.mount(source, mountPoint, extraConfigs=None)` | ✅ **Supported** — Microsoft Entra (default), `accountKey`, or `sasToken` auth. For cross-workspace / persistent sharing, prefer **OneLake Shortcuts** |84| `dbutils.secrets.get(scope, key)` | `notebookutils.credentials.getSecret(keyVaultUrl, secretName)` | Scope → Key Vault URL; key → secret name |85| `dbutils.notebook.run(path, timeout, args)` | `notebookutils.notebook.run(name, timeout, args)` | `path` → notebook `name` (relative to workspace) |86| `dbutils.notebook.exit(value)` | `notebookutils.notebook.exit(value)` | **Direct replacement** |87| `dbutils.widgets.get(name)` | See [§ Widgets Migration](#widgets-migration) | No direct equivalent |88| `dbutils.library.install(...)` | **Not available at runtime** — use **Fabric Environments** | `dbutils.library.restartPython()` → `notebookutils.session.restartPython()` |89| `dbutils.data.summarize(df)` | `display(df.summary())` | Use `display()` or pandas `describe()` |9091### Widgets Migration9293`dbutils.widgets` has no direct equivalent in Fabric. Use these patterns instead:9495| Use Case | Fabric Pattern |96|---|---|97| Pass parameter from parent notebook | Mark a cell in the child notebook as a **parameters cell** (notebook UI: cell "..." menu → "Mark cell as parameters"). The parent calls `notebookutils.notebook.run("child", arguments={"param": "value"})` — at runtime the engine inserts a new cell beneath the parameters cell that overrides the defaults |98| Pipeline-driven parameterization | Same parameters-cell mechanism; the Fabric Pipeline notebook activity supplies override values via its **Base parameters** setting |99| Centralized cross-notebook config | Use `notebookutils.variableLibrary.getLibrary("<name>")` to read values from a Variable Library item (deployment pipelines activate the right value set per stage) |100| Interactive selection in notebook | Use `display()` with input cells, IPython widgets (Python only), or Fabric Data Activator |101102> Note: `notebookutils.runtime.context` does **not** expose parameter values. It's for execution metadata (workspace/notebook/activity/user IDs, pipeline-vs-interactive flags, etc.). See [dbutils-to-notebookutils.md § Runtime Context](resources/dbutils-to-notebookutils.md#runtime-context).103104---105106## Cluster Config → Fabric Spark Pools107108| Databricks Cluster Concept | Fabric Spark Equivalent | Notes |109|---|---|---|110| All-purpose cluster (interactive) | **Starter Pool** | Auto-provisioned; no config; ideal for notebooks |111| Job cluster (single-use for jobs) | **Custom Pool** (or Starter Pool) attached to SJD | Configure node size, autoscale in Fabric capacity settings |112| Node type (e.g., `Standard_DS3_v2`) | **Fabric node size** (Small/Medium/Large/X-Large/XX-Large) | Map by vCore/memory ratio |113| Autoscale min/max workers | Custom Pool **min/max node** settings | Available in workspace Spark settings |114| `spark.conf` in cluster settings | **Fabric Environment** Spark properties | Move to Environment item; attach to workspace or notebook |115| `init_scripts` (cluster init) | **Fabric Environment** install script | Not fully equivalent — only library installs are supported |116| Databricks Runtime version | **Fabric Runtime** (1.1 = Spark 3.3, 1.2 = Spark 3.4, 1.3 = Spark 3.5) | Choose matching Spark version; test deprecated APIs |117| Photon accelerator | **Fabric Native Execution Engine (NEE)** | Enable in workspace Spark settings; vectorized execution similar to Photon |118119---120121## Databricks Jobs → Spark Job Definitions122123| Databricks Jobs Concept | Fabric SJD Equivalent | Notes |124|---|---|---|125| Job with single notebook task | **SJD** referencing a notebook | Attach a default Lakehouse; pass parameters via SJD args |126| Multi-task job (DAG of tasks) | **Fabric Data Pipeline** orchestrating multiple SJDs/notebooks | Pipeline activities map to job tasks; dependencies = activity dependencies |127| Job schedule (cron) | **Pipeline schedule trigger** | Cron expression → recurrence trigger in pipeline |128| Job parameters | **SJD default arguments** or **notebook cell parameters** | Parameters cell in notebook is injected at runtime |129| Job clusters per task | **Pool attached to SJD** | Each SJD can specify its Spark pool independently |130| Databricks Workflows | **Fabric Data Pipelines** | Full DAG orchestration with conditions, loops, and failure branches |131132> **Delegate to `spark-cli`** for SJD creation and notebook deployment.133134---135136## Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts137138| Databricks Delta Sharing Pattern | Fabric Equivalent |139|---|---|140| Provider publishes a Delta share | Fabric **external data sharing** for cross-tenant Fabric data, or a OneLake Shortcut to ADLS Gen2 where the Delta data resides |141| Recipient reads shared data | Accept the external data share into a Lakehouse (Fabric creates a read-only OneLake Shortcut), or create a direct **OneLake Shortcut** to accessible ADLS Gen2 data |142| Cross-workspace table sharing within org | **OneLake Shortcuts** pointing to another workspace's Lakehouse tables — no data copy |143| Cross-tenant sharing | Fabric **external data sharing** — live, read-only, in-place access through a shortcut in the recipient tenant |144145When producing a migration workload map, include both paths: direct OneLake Shortcuts for accessible ADLS or same-tenant OneLake data, and Fabric external data sharing for native cross-tenant recipient sharing.146147---148149## MLflow → Fabric ML Experiments150151Fabric ML Experiments are built on the MLflow SDK — most code is directly portable:152153| Databricks MLflow Pattern | Fabric Equivalent | Migration Action |154|---|---|---|155| `mlflow.set_tracking_uri("databricks")` | Remove — Fabric tracking is automatic | Delete this line in Fabric notebooks |156| `mlflow.set_experiment("/path/exp")` | `mlflow.set_experiment("experiment_name")` | Use name only (not path); Fabric creates the Experiment item |157| `mlflow.log_metric(...)` | `mlflow.log_metric(...)` — **identical** | No change |158| `mlflow.log_artifact(...)` | `mlflow.log_artifact(...)` — **identical** | No change |159| `mlflow.autolog()` | `mlflow.autolog()` — **identical** | No change |160| `mlflow.register_model(...)` | `mlflow.register_model(...)` — **identical** | Model Registry is available in Fabric ML |161| Databricks Model Serving | **Azure ML Online Endpoints** or **Fabric Data Activator** | No direct Fabric model serving yet — use Azure ML |162163---164165## Must / Prefer / Avoid166167### MUST DO168- **Inventory before prescribing a workspace topology** — for workspace-wide requests that omit workload inventory, dependencies, security requirements, data locations, or runtime constraints, ask focused clarifying questions and present conditional choices before selecting a Fabric design169- **Replace all `dbutils.*` calls** using the mapping in [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) — `dbutils` is not available in Fabric notebooks170- **Migrate `dbutils.fs.mount()` to `notebookutils.fs.mount()`** (✅ supported — Microsoft Entra default, or `accountKey` / `sasToken` from Key Vault). For cross-workspace or persistent sharing, prefer **OneLake Shortcuts** instead. Always pair `mount()` with `unmount()` in `try/finally` — Fabric mounts are not released automatically on session end171- **Replace `dbutils.secrets.get(scope, key)`** with `notebookutils.credentials.getSecret(keyVaultUrl, secretName)` — secret scopes map to Azure Key Vault URLs172- **Redesign widget-based parameter passing** using notebook **parameters cells** (cell "..." menu → "Mark cell as parameters"); use `notebookutils.variableLibrary` for centralized cross-notebook config. `notebookutils.runtime.context` does **not** expose parameter values173- **Replace `dbutils.library.install*()`** with Fabric **Environments** — runtime library installs are not supported in production. `dbutils.library.restartPython()` maps to `notebookutils.session.restartPython()` (Python / PySpark only)174- **Adapt Unity Catalog 3-level namespaces** (`catalog.schema.table`) to Fabric 2-level (`schema.table` within a Lakehouse) — see [catalog-migration.md](resources/catalog-migration.md)175- **Map Databricks cluster init scripts** to Fabric Environments — cluster-level library installs must move to Environment items176177### PREFER178- **Fabric Native Execution Engine (NEE)** as the Photon equivalent — enable in workspace Spark settings for vectorized execution on Delta Lake179- **OneLake Shortcuts** over data copy for Delta tables that already exist in ADLS Gen2 — point directly without re-ingesting180- **Fabric Git Integration** as the replacement for Databricks Repos — connect workspace to ADO or GitHub for notebook version control181- **Fabric ML Experiments** for direct MLflow continuity — tracking code requires minimal changes (remove `set_tracking_uri`)182- **Medallion architecture** when restructuring migrated Databricks catalogs — align `bronze`, `silver`, `gold` Unity Catalog schemas to separate Fabric Lakehouses183- **Starter Pool** for migrating interactive notebook workflows — eliminates cluster startup time that was a common pain point in Databricks job clusters184185### AVOID186- **Do not prescribe a one-size-fits-all workspace topology** when the source inventory and migration constraints are missing187- **Do not import `dbutils` or attempt `dbutils = ...` assignments** in Fabric notebooks — import attempts fail with `ModuleNotFoundError`, while unresolved `dbutils` references raise `NameError`; always use `notebookutils`188- **Do not retain `dbutils.*` calls behind runtime-detection guards** (`try/except`, `if IS_DATABRICKS`) — replace the calls and Databricks paths outright with `notebookutils` and Fabric paths189- **Do not assume Unity Catalog governance policies transfer automatically** — RBAC, row-level security, and column masking must be reconfigured in Fabric using workspace roles and Lakehouse permissions190- **Do not use `%pip install` in production Fabric notebooks** at runtime — use Fabric Environments for stable, versioned library management191- **Do not attempt to port Delta Live Tables (DLT) pipelines verbatim** — DLT has no Fabric equivalent; rewrite as parameterized notebooks orchestrated by Fabric Pipelines192- **Do not rely on Databricks-specific Spark configurations** (e.g., `spark.databricks.*`) — these are proprietary and will be silently ignored or raise errors in Fabric193- **Do not use DBFS paths** (`dbfs:/...`) — there is no DBFS in Fabric; all paths must use OneLake `abfss://` or Lakehouse-relative paths194195---196197## Examples198199See [dbutils-to-notebookutils.md](resources/dbutils-to-notebookutils.md) and [code-patterns.md](resources/code-patterns.md) for the full mapping. Key quick references:200201**`dbutils.fs` → `notebookutils.fs`**202203```python204# Databricks205dbutils.fs.ls("/mnt/bronze/orders/")206dbutils.fs.cp("/mnt/raw/file.csv", "/mnt/archive/file.csv")207208# Fabric (replace DBFS/mount paths with OneLake relative paths)209notebookutils.fs.ls("Files/bronze/orders/")210notebookutils.fs.cp("Files/raw/file.csv", "Files/archive/file.csv")211```212213**`dbutils.secrets` → `notebookutils.credentials`**214215```python216# Databricks217pwd = dbutils.secrets.get(scope="prod", key="db-password")218219# Fabric (scope → Key Vault URL, key → secret name)220pwd = notebookutils.credentials.getSecret("https://myvault.vault.azure.net/", "db-password")221```222223**Unity Catalog namespace → Lakehouse schema**224225```python226# Databricks227df = spark.read.table("prod.silver.customers")228229# Fabric (catalog dropped; Lakehouse context provides it)230df = spark.read.table("silver.customers")231```