Generated banner for Databricks Migration
Generated logo for Databricks Migration

Databricks Migration

MicrosoftOfficialPublished by Microsoft

  • Skill
  • Workflow
  • Cloud and DevOps
  • MIT
  • Low risk

From the author

Ports existing Databricks notebooks and jobs to Fabric, covering dbutils to notebookutils, secret scopes to Key Vault, DBFS to OneLake, Unity Catalog mapping to schema-enabled Lakehouses, Jobs and Delta Live Tables to Spark Job Definitions and Pipelines, and Photon to the Native Execution Engine. Use whenever Databricks code has to be converted. For Fabric notebook code that is not being migrated, use spark-cli.
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The databricks-migration skill provides a structured framework for porting Databricks assets to Microsoft Fabric. It covers the conversion of core components including dbutils to notebookutils, secret scopes to Azure Key Vault, DBFS to OneLake, and Unity Catalog structures to schema-enabled Lakehouses. The skill emphasizes a systematic approach, requiring inventory assessment before prescribing topology, and provides specific mappings for Spark job definitions, MLflow experiments, and cluster configurations to ensure a smooth transition to Fabric's native execution environment.

What it does

  • Maps dbutils API calls to their notebookutils equivalents.
  • Provides strategies for migrating Unity Catalog namespaces to Fabric Lakehouse schemas.
  • Translates Databricks Jobs and Delta Live Tables into Fabric Spark Job Definitions and Pipelines.
  • Guides the transition from Databricks cluster configurations to Fabric Spark Pools and Environments.
  • Facilitates the migration of MLflow tracking and model registry workflows.
  • Defines a multi-notebook migration protocol to manage complex workspace transitions.

When to use it

  • When porting existing Databricks notebooks, jobs, or data pipelines to Microsoft Fabric.
  • When needing to resolve namespace collisions during catalog migration.
  • When replacing proprietary Databricks features like DLT or DBFS with Fabric-native alternatives.
  • When configuring security and secret management for migrated workloads in Fabric.

Advantages

  • Ensures architectural alignment with Fabric's native execution engine.
  • Provides clear, actionable mappings for deprecated Databricks-specific APIs.
  • Reduces manual effort through structured migration patterns and protocols.
  • Promotes best practices for library management and environment configuration in Fabric.

Usage examples

“How do I migrate my dbutils.fs.ls calls to Fabric?”
The agent will provide the equivalent notebookutils.fs.ls syntax and explain the necessary path adjustments from DBFS to OneLake.
“I need to move my Databricks Unity Catalog to Fabric. What is the recommended approach?”
The agent will guide you through mapping Unity Catalog catalogs to schema-enabled Lakehouses and explain how to handle namespace preservation.
“How should I handle Databricks Jobs that use Delta Live Tables?”
The agent will explain that DLT has no direct equivalent and will provide a plan to rewrite the logic as parameterized notebooks orchestrated by Fabric Pipelines.
“What is the Fabric equivalent for my Databricks secret scopes?”
The agent will instruct you to use notebookutils.credentials.getSecret, mapping the Databricks scope to an Azure Key Vault URL.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/microsoft/databricks-migration/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip databricks-migration.zip -d .agents/skills

Documentation by Microsoft

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

  1. To find workspace details (including its ID) from a workspace name: list all workspaces, then use JMESPath filtering

  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 filtering

  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 ID

  4. dbutils.library (runtime library install) has no equivalent — use Fabric Environments for reproducible library management

  5. Map each Unity Catalog catalog to a schema-enabled Lakehouse by default. This preserves the source schema.table hierarchy, with the Lakehouse representing the catalog; collisions arise only if multiple catalogs are intentionally consolidated into one Lakehouse

  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 topology

  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 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

TopicReference
Migration Orchestratormigration-orchestrator.md
Migration Workload Map§ Migration Workload Map
Complete dbutils → notebookutils Mappingdbutils-to-notebookutils.md
Unity Catalog → Fabric Lakehouse Schemascatalog-migration.md
Before/After Code Patternscode-patterns.md
Cluster Config → Fabric Spark Pools§ Cluster Config → Fabric Spark Pools
Databricks Jobs → Spark Job Definitions§ Databricks Jobs → Spark Job Definitions
Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts§ Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts
MLflow → Fabric ML Experiments§ MLflow → Fabric ML Experiments
Post-Migration Validation & Testingvalidation-testing.md
Migration Gotchas & Troubleshootingmigration-gotchas.md
Multi-Notebook Migration Protocol§ Multi-Notebook Migration Protocol
Failure Reporting§ Failure Reporting
Must / Prefer / Avoid§ Must / Prefer / Avoid
Authentication & Token AcquisitionCOMMON-CORE.md § Authentication
Lakehouse ManagementSPARK-AUTHORING-CORE.md § Lakehouse Management
Notebook ManagementSPARK-AUTHORING-CORE.md § Notebook Management
Context Loading Guide

IMPORTANT — Load only what you need. Do NOT read all resource files upfront. Load the specific file for the phase you are executing:

WhenRead This File
User asks to migrate a workspace (full orchestration)migration-orchestrator.md
Applying code transforms (dbutils, namespaces, paths)dbutils-to-notebookutils.md + code-patterns.md
Resolving Unity Catalog namespace collisionscatalog-migration.md
Post-migration verificationvalidation-testing.md
Troubleshooting failures or known issuesmigration-gotchas.md

Migration Workload Map

Databricks ComponentFabric TargetSeverityNotes
All-purpose cluster (notebooks, REPL)Fabric Notebook (Starter Pool or Custom Pool)InfoNo persistent cluster — Fabric provisions compute on session start
Job cluster (automated jobs)Spark Job Definition (SJD)InfoSJD maps one-to-one with Databricks Jobs on job clusters
Unity CatalogFabric Lakehouse (schema-enabled, one per catalog)InfoSchema-enabled Lakehouse preserves schema.table; default one-Lakehouse-per-catalog has no collision — see catalog-migration.md
Databricks Repos (Git-backed notebooks)Fabric Git IntegrationInfoConnect workspace to Azure DevOps or GitHub; notebooks are synced
Delta Live Tables (DLT)Fabric Notebooks + Data PipelinesBlockerNo DLT equivalent — rewrite DLT datasets as parameterized notebook cells with pipeline orchestration
Databricks SQL WarehousesFabric Warehouse or Lakehouse SQL EndpointInfoSQL warehouse sessions → Warehouse (for write) or SQL Endpoint (for read-only)
MLflow TrackingFabric ML ExperimentsInfoMLflow SDK is supported in Fabric — see § MLflow
Delta SharingOneLake Shortcuts + Fabric external data sharingWarningSee § Delta Sharing → Fabric External Data Sharing and OneLake Shortcuts
Databricks Feature StoreFeature engineering on Lakehouse/Delta tables + MLflowWarningFabric has no drop-in managed Feature Store; recreate feature tables as Delta tables in a Lakehouse and manage features via notebooks/MLflow. Verify current Fabric feature-store roadmap before committing an approach
dbutils (all sub-modules)notebookutils (most sub-modules)InfoSee dbutils-to-notebookutils.md for full mapping
Scala notebooksFabric Notebook (Spark/Scala)WarningScala is supported; swap cell magic %scala → %%spark and rewrite Databricks-specific APIs/libraries
R notebooksFabric Notebook (SparkR)WarningSparkR is supported; swap cell magic %r → %%sparkr, validate package availability, rewrite Databricks-specific APIs
Severity Definitions
LevelMeaningAction
BlockerCannot run in Fabric without redesign or user decisionStop — surface to user, require resolution
WarningMigratable but requires validation or architectural decisionMigrate with review flag
InfoDirect substitution-level changeAuto-migrate

dbutils → notebookutils Quick Reference

The complete side-by-side API table is in dbutils-to-notebookutils.md. The key mappings are:

dbutils Callnotebookutils EquivalentCompatibility 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 MigrationNo direct equivalent
dbutils.library.install(...)Not available at runtime — use Fabric Environmentsdbutils.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 CaseFabric Pattern
Pass parameter from parent notebookMark 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 parameterizationSame parameters-cell mechanism; the Fabric Pipeline notebook activity supplies override values via its Base parameters setting
Centralized cross-notebook configUse notebookutils.variableLibrary.getLibrary("<name>") to read values from a Variable Library item (deployment pipelines activate the right value set per stage)
Interactive selection in notebookUse 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 ConceptFabric Spark EquivalentNotes
All-purpose cluster (interactive)Starter PoolAuto-provisioned; no config; ideal for notebooks
Job cluster (single-use for jobs)Custom Pool (or Starter Pool) attached to SJDConfigure 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 workersCustom Pool min/max node settingsAvailable in workspace Spark settings
spark.conf in cluster settingsFabric Environment Spark propertiesMove to Environment item; attach to workspace or notebook
init_scripts (cluster init)Fabric Environment install scriptNot fully equivalent — only library installs are supported
Databricks Runtime versionFabric Runtime (1.1 = Spark 3.3, 1.2 = Spark 3.4, 1.3 = Spark 3.5)Choose matching Spark version; test deprecated APIs
Photon acceleratorFabric Native Execution Engine (NEE)Enable in workspace Spark settings; vectorized execution similar to Photon

Databricks Jobs → Spark Job Definitions

Databricks Jobs ConceptFabric SJD EquivalentNotes
Job with single notebook taskSJD referencing a notebookAttach a default Lakehouse; pass parameters via SJD args
Multi-task job (DAG of tasks)Fabric Data Pipeline orchestrating multiple SJDs/notebooksPipeline activities map to job tasks; dependencies = activity dependencies
Job schedule (cron)Pipeline schedule triggerCron expression → recurrence trigger in pipeline
Job parametersSJD default arguments or notebook cell parametersParameters cell in notebook is injected at runtime
Job clusters per taskPool attached to SJDEach SJD can specify its Spark pool independently
Databricks WorkflowsFabric Data PipelinesFull 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 PatternFabric Equivalent
Provider publishes a Delta shareFabric external data sharing for cross-tenant Fabric data, or a OneLake Shortcut to ADLS Gen2 where the Delta data resides
Recipient reads shared dataAccept 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 orgOneLake Shortcuts pointing to another workspace's Lakehouse tables — no data copy
Cross-tenant sharingFabric 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 PatternFabric EquivalentMigration Action
mlflow.set_tracking_uri("databricks")Remove — Fabric tracking is automaticDelete 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(...) — identicalNo change
mlflow.log_artifact(...)mlflow.log_artifact(...) — identicalNo change
mlflow.autolog()mlflow.autolog() — identicalNo change
mlflow.register_model(...)mlflow.register_model(...) — identicalModel Registry is available in Fabric ML
Databricks Model ServingAzure ML Online Endpoints or Fabric Data ActivatorNo 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)

  • Map Unity Catalog namespaces deliberately — default to one schema-enabled Lakehouse per catalog so schema.table is preserved; require a user-approved naming policy only when consolidating multiple catalogs into one 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


Multi-Notebook Migration Protocol

For workspaces with >3 notebooks or individual notebooks >5KB, process one notebook at a time (enumerate → export → transform → summarize → deploy → release) to avoid context overflow. Track each notebook through a status lifecycle (inventory → analyzed → converted → deployed → validated, or failed).

Full protocol, status definitions, and per-notebook summary schema: migration-orchestrator.md § Phase 2.


Failure Reporting

When migration cannot complete (permission failures, unresolvable Blockers such as DLT or OS-level init scripts, namespace collisions with no user-chosen policy, or repeated API failures), emit a structured failure report — do not abandon silently. The report captures phase_reached, blockers[] (item / pattern / reason / recommendation), partial_success counts, and next_steps.

Full report schema and stopping conditions: migration-orchestrator.md § Failure Reporting.


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 (ProdLakehouse represents the source catalog and is attached as context)
df = spark.read.table("silver.customers")

Files

resources/validation-testing.md

Post-Migration Validation & Testing

Systematic verification that migrated Databricks items work correctly in Fabric before cutover.

Script pattern: Sections show function signatures and key logic outlines. Generate the full runnable script on demand — this keeps the resource compact and reduces token load.

When to run: Validation runs incrementally after each phase, not only at the end.

After PhaseRun These SectionsGate
Phase 1 (Environments + Lakehouses)V1, V2Do not proceed to Phase 2 until Environments publish and Shortcuts are healthy
Phase 2 (Notebooks)V3Do not proceed to Phase 3 until critical notebooks execute successfully
Phase 3 (Jobs + Pipelines)V4Do not cut over until SJDs/Pipelines pass
Phase 4 (Full validation)V5, V6Migration complete only when report is green

Auth token: Use the token-acquisition recipe in COMMON-CLI § Authentication Recipes with audience https://api.fabric.microsoft.com.


Validation Workflow

Validation:
├── V1: Environment validation (Phase 1 outputs)
├── V2: Data validation (Lakehouses, Shortcuts, Tables)
├── V3: Notebook execution testing (Phase 2 outputs)
├── V4: Job/Pipeline execution testing (Phase 3 outputs)
├── V5: Output comparison (Databricks vs Fabric)
└── V6: Generate validation report

Default Validation Tolerances

Apply these tolerances consistently across all comparisons. Exact equality is required only where noted; numeric aggregates use a relative tolerance so large magnitudes do not false-fail.

CheckTolerance / Rule
Row countExact match — any difference is a failure
SchemaColumn name must match exactly; type must be compatible (e.g., nullable widening is acceptable, a type change is not)
Numeric aggregate (sum, avg, min, max)Pass if abs(expected - actual) <= max(abs_tol, rel_tol * max(abs(expected), abs(actual))) with abs_tol = 1e-3, rel_tol = 1e-9. A raw absolute threshold alone false-fails large sums
SamplingUse a fixed seed for reproducible sample comparisons
Overall resultPASS = all checks green; PARTIAL = only warning-level diffs; FAIL = any exact-match check (row count / schema / blocker) fails
def within_tolerance(expected, actual, abs_tol=1e-3, rel_tol=1e-9):
    """True if expected and actual agree within absolute OR relative tolerance.
    The relative term prevents false failures on large-magnitude aggregates."""
    delta = abs(expected - actual)
    scale = max(abs(expected), abs(actual))
    return delta <= abs_tol or delta <= rel_tol * scale

V1: Environment Validation

Verify that Fabric Environments created in Phase 1 are published and usable.

Check Environment Publish Status
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/environments/{environmentId}

Check properties.publishDetails.state — must be "Success".

Validate Libraries

Run a test notebook attached to each Environment to confirm libraries are importable:

# Verify critical libraries are importable
import_errors = []
required_libs = {
    "pandas": "pandas",
    "scikit-learn": "sklearn",
    "mlflow": "mlflow",
    # ... from the Databricks cluster library list
}

for pkg, module in required_libs.items():
    try:
        __import__(module)
    except ImportError:
        import_errors.append(pkg)

assert len(import_errors) == 0, f"Missing libraries: {import_errors}"
Validate Spark Runtime Version
# Check Fabric Runtime version meets the minimum expectation.
# Fabric Runtime 1.1 = Spark 3.3, 1.2 = Spark 3.4, 1.3 = Spark 3.5.
# Assert a *minimum* (not an exact version) so the check passes on any supported runtime.
print(f"Spark version: {spark.version}")
major_minor = tuple(int(x) for x in spark.version.split(".")[:2])
assert major_minor >= (3, 3), f"Expected Spark >= 3.3, got {spark.version}"

V2: Data Validation

Verify Lakehouses and OneLake Shortcuts are healthy and accessible.

Check Shortcut Health
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{lakehouseId}/shortcuts

For each shortcut, verify:

  • Status is not "Failed" or "Disconnected"

  • Target path is accessible (attempt a notebookutils.fs.ls() on the shortcut path)

Row Count Comparison

Compare row counts between Databricks source tables and Fabric Lakehouse tables:

def compare_row_counts(source_counts: dict, fabric_spark) -> list:
    """
    source_counts: dict mapping "schema.table" → row_count from Databricks
    fabric_spark: active SparkSession in Fabric
    Returns list of mismatches
    """
    mismatches = []
    for table_name, expected_count in source_counts.items():
        actual_count = fabric_spark.table(table_name).count()
        if actual_count != expected_count:
            mismatches.append({
                "table": table_name,
                "expected": expected_count,
                "actual": actual_count,
                "delta": actual_count - expected_count
            })
    return mismatches
Schema Comparison
def compare_schemas(source_schema: dict, fabric_spark) -> list:
    """
    source_schema: dict mapping "schema.table" → list of (col_name, col_type) from Databricks
    Returns list of schema differences
    """
    differences = []
    for table_name, expected_cols in source_schema.items():
        actual_cols = [(f.name, str(f.dataType)) for f in fabric_spark.table(table_name).schema.fields]
        if set(actual_cols) != set(expected_cols):
            differences.append({
                "table": table_name,
                "missing_in_fabric": set(expected_cols) - set(actual_cols),
                "extra_in_fabric": set(actual_cols) - set(expected_cols)
            })
    return differences

V3: Notebook Execution Testing

Execute migrated notebooks and verify they complete without errors.

Execution via REST API
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{notebookId}/jobs/RunNotebook/instances

The job type is part of the path (.../jobs/{jobType}/instances). The older query-string form (.../jobs/instances?jobType=RunNotebook) still works for backward compatibility.

Poll for completion:

GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{notebookId}/jobs/instances/{instanceId}
Execution Result Classification
StatusMeaningAction
CompletedNotebook ran successfully✅ Pass
FailedRuntime error, or the run exceeded its configured timeoutInvestigate cell outputs and duration; raise the job timeout only if the run is legitimately long
CancelledExplicitly cancelled by a user or the system — not a timeoutDo not auto-retry; determine why it was cancelled first
DequeuedCapacity unavailableWait for capacity; retry
Common Post-Migration Failures
ErrorRoot CauseFix
NameError: name 'dbutils' is not definedMissed dbutils → notebookutils transformRe-scan notebook for remaining dbutils references
AnalysisException: Table or view not foundIncorrect catalog-to-Lakehouse mapping or missing Lakehouse attachmentVerify the source catalog maps to the attached Lakehouse and the table uses its preserved schema.table name
Py4JJavaError: Path does not exist: dbfs:/...DBFS path not converted to OneLakeReplace with Files/... or abfss:// path
ModuleNotFoundError: No module named '...'Library not in Fabric EnvironmentAdd to Environment and republish
PermissionError on Key Vault accessSecret scope mapping incorrectVerify notebookutils.credentials.getSecret(kvUrl, secretName) references correct vault

V4: Job/Pipeline Execution Testing

Spark Job Definition Validation

Trigger a test run of each migrated SJD:

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{sjdId}/jobs/SparkJob/instances
Pipeline Validation

For migrated Data Pipelines (from multi-task Databricks Jobs):

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{pipelineId}/jobs/Pipeline/instances

Verify:

  • All activities complete successfully

  • Activity dependencies execute in correct order

  • Schedule triggers fire at expected times (if enabled)


V5: Output Comparison (Databricks vs Fabric)

For critical tables/outputs, compare data between the Databricks source and Fabric target:

Comparison Strategy
Data VolumeApproach
< 10K rowsFull row-level comparison (exceptAll)
10K–1M rowsSample comparison (random 1% + statistical checks)
> 1M rowsAggregate comparison (counts, sums, min/max, null counts per column)
Row-Level Comparison (Small Tables)
def compare_outputs(databricks_df, fabric_df) -> dict:
    """Compare two DataFrames for exact equality (symmetric diff)."""
    results = {
        "row_count_match": databricks_df.count() == fabric_df.count(),
        "schema_match": databricks_df.schema == fabric_df.schema,
    }
    if results["schema_match"]:
        missing_in_fabric = databricks_df.exceptAll(fabric_df).count()
        extra_in_fabric = fabric_df.exceptAll(databricks_df).count()
        results["missing_in_fabric"] = missing_in_fabric
        results["extra_in_fabric"] = extra_in_fabric
        results["pass"] = results["row_count_match"] and missing_in_fabric == 0 and extra_in_fabric == 0
    else:
        results["pass"] = False
    return results
Aggregate Comparison (Large Tables)
def aggregate_comparison(databricks_df, fabric_df, numeric_cols: list) -> dict:
    """Statistical comparison for large tables."""
    from pyspark.sql import functions as F
    
    stats = {}
    for col_name in numeric_cols:
        db_stats = databricks_df.agg(
            F.count(col_name).alias("count"),
            F.sum(col_name).alias("sum"),
            F.avg(col_name).alias("avg"),
            F.min(col_name).alias("min"),
            F.max(col_name).alias("max")
        ).collect()[0]
        
        fb_stats = fabric_df.agg(
            F.count(col_name).alias("count"),
            F.sum(col_name).alias("sum"),
            F.avg(col_name).alias("avg"),
            F.min(col_name).alias("min"),
            F.max(col_name).alias("max")
        ).collect()[0]
        
        stats[col_name] = {
            "count_match": db_stats["count"] == fb_stats["count"],
            "sum_match": within_tolerance(db_stats["sum"], fb_stats["sum"]),
            "avg_match": within_tolerance(db_stats["avg"], fb_stats["avg"]),
        }
    return stats

Uses within_tolerance() from Default Validation Tolerances above — a raw abs(...) < 0.001 check false-fails large SUMs, so the relative term is required.


V6: Generate Validation Report

Produce a structured report summarizing all validation results:

validation_report:
  workspace: <fabric_workspace>
  source: <databricks_workspace>
  timestamp: <ISO 8601>
  
  environment_validation:
    status: PASS | FAIL
    environments_checked: 3
    libraries_verified: 12
    failures: []
    
  data_validation:
    status: PASS | FAIL
    tables_checked: 24
    row_count_mismatches: []
    schema_mismatches: []
    shortcuts_healthy: true
    
  notebook_validation:
    status: PASS | PARTIAL | FAIL
    notebooks_tested: 38
    passed: 36
    failed: 2
    failures:
      - notebook: silver_transform
        error: "NameError: name 'dbutils' is not defined"
        cell: 5
        
  job_validation:
    status: PASS | FAIL
    sjds_tested: 4
    pipelines_tested: 2
    failures: []
    
  output_comparison:
    status: PASS | PARTIAL | FAIL
    tables_compared: 8
    exact_matches: 7
    aggregate_matches: 1
    mismatches: []
    
  overall_status: PASS | PARTIAL | FAIL
  blockers_remaining: 0
  ready_for_cutover: true | false
  
  recommendations:
    - "Fix remaining dbutils reference in silver_transform notebook (cell 5)"
    - "Verify schedule triggers after cutover"
Report Status Definitions
StatusMeaningAction
PASSAll checks greenSafe to cutover
PARTIALSome items pass, some have warningsReview warnings; decide if acceptable
FAILCritical failures prevent cutoverFix failures before proceeding

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python, Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Microsoft
Publisher
Microsoft (Official)
Source
microsoft/skills-for-fabric · skills/databricks-migration · commit f8fac11
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
microsoft/skills-for-fabric

AutoGineer is not affiliated with or endorsed by Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download databricks-migration.zip