Synapse Migration
MicrosoftOfficialPublished by Microsoft
- Skill
- Workflow
- Software development
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The synapse-migration skill provides a structured, phased workflow for transitioning Synapse Analytics workspaces to Microsoft Fabric. It covers the migration of Spark items, Lake Databases, Linked Services, and Dedicated SQL Pool schema and stored procedures. The skill emphasizes a dependency-ordered approach, requiring gap assessment and explicit approval before conversion. It distinguishes between migrating to a Fabric Lakehouse (schema and code only, no data movement) and a Fabric Warehouse, while providing specific routing for dependent pipeline callers.
What it does
- Discovers and classifies Synapse workspace artifacts.
- Converts Dedicated SQL Pool schema and stored procedures to Spark SQL notebooks or Warehouse objects.
- Migrates Spark items, including notebooks and Spark Job Definitions, to Fabric equivalents.
- Maps Linked Services to Fabric Data Connections or OneLake Shortcuts.
- Manages the migration of approved dependent pipeline callers.
- Validates persisted definitions and artifacts against established contracts.
When to use it
- When migrating a full Synapse workspace to Microsoft Fabric.
- When converting Dedicated SQL Pool schema and procedures to a Lakehouse or Warehouse.
- When porting Spark pools, notebooks, or Spark Job Definitions to Fabric.
- When replacing Synapse Linked Services with Fabric-native connectivity.
Advantages
- Ensures dependency-ordered migration to maintain system integrity.
- Provides clear routing for different workload types (Lakehouse vs. Warehouse).
- Enforces strict validation and approval gates for behavior-changing decisions.
- Supports incremental migration rather than high-risk big-bang cutovers.
- Standardizes the conversion of T-SQL procedures to executable Spark SQL notebooks.
Usage examples
- “Migrate this Dedicated SQL Pool DACPAC to a Fabric Lakehouse and convert the procedures.”
- The agent will assess gaps, obtain approval for procedure-to-notebook mappings, create a migration manifest, convert schema/code artifacts, and validate the results.
- “Migrate this Dedicated SQL Pool to Fabric Warehouse.”
- The agent will assess DDL compatibility, remove unsupported distribution/index declarations, obtain provisioning consent, and prepare for potential data migration.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/synapse-migration/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip synapse-migration.zip -d .agents/skills
Documentation by Microsoft
Telemetry — MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: synapse-migration(az rest:--headers "x-ms-fabric-skill=synapse-migration"), including every LRO poll,fabric_lroand retry. Snippets omit it — add it anyway.
OFFLINE LAKEHOUSE ARTIFACT FAST PATH — DECIDE FIRST. For a no-live-call request with complete supplied inputs and contracts, load only the fast path; do not load
migration-planning-reference.md,dedicated-pool-conversion.md, or implementation scripts. Use one generator for artifacts and final-byte hashes, then one verifier. Do not inspect generated files or run post-pass spot checks. For every optional non-null source default, setmissingValueBehaviortoUseSourceDefaultand restore that default before validation. Do not use this path for a Warehouse target; incomplete and large-procedure requests use their own routes.
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.
Treat a source Dedicated SQL Pool as read-only. Do not run source DDL, DML, stored procedures, or create sample objects.
Dedicated Pool-to-Lakehouse data movement is out of scope. Migrate schema and executable code artifacts only; do not copy source rows or run row-level/business-result equivalence queries. The separate Warehouse route may move data only from a separately approved restored export copy under its own consent gate and restored-source contract.
For Dedicated Pool-to-Lakehouse requests, complete gap assessment, explicit mapping approval, manifest creation, conversion, deployment, and validation in order. Read dedicated-pool-to-lakehouse.md once as the router, then load only the current phase reference.
Stored-procedure
1:1,N:1, andN:Nmappings never apply to views. Views remain schema objects; procedures become traceable Spark SQL notebooks with executable%%sqltransformation cells.Dependent ADF/Synapse callers are conditional scope, not automatic scope. Discover them during assessment, require a separate complete-closure approval, and migrate them only after notebook readiness. Route standalone pipeline requests to
pipeline-migration.Before executing a specialized Dedicated Pool workflow, read the matching contract in dedicated-pool-execution-contracts.md. Its validation, hashing, request-body, resume, and completion-language requirements are mandatory.
Keep Lakehouse and Warehouse paths separate. If the target is unclear, ask before loading path-specific resources. Lakehouse conversion never moves source rows; Warehouse data migration requires its own explicit consent gate and restored-source contract.
For a Fabric Warehouse target, explicitly state that the complete
DISTRIBUTIONandCLUSTERED COLUMNSTORE INDEXdeclarations are removed because Fabric manages distribution, storage, and indexing; a bare mention of either source clause is insufficient.Run setup DDL and CETAS only against the separately approved restored export copy after proving it is not the original production source.
Synapse Analytics to Microsoft Fabric Migration
Core Workflow
Discover the Synapse workspace and classify every source artifact.
Choose targets using workload-routing.md.
Assess gaps before conversion, including runtime, library, connectivity, T-SQL, security, and capacity constraints.
Obtain approval for behavior-changing decisions, target placement, and every stored-procedure-to-notebook mapping.
Create or update
migration-manifest.jsonand persist approval, per-object status, hashes, and checkpoints atomically.Convert and deploy in dependency order, loading only the current phase resource.
Validate persisted definitions and artifacts without executing generated notebooks or pipelines unless a separately approved workflow explicitly requires execution.
Report completed, blocked, skipped, and pending objects without exposing credentials or sensitive values.
For full-workspace orchestration, read migration-orchestrator.md. For a Dedicated Pool-to-Lakehouse migration, use dedicated-pool-to-lakehouse.md as the phase router. For a Warehouse target, load only the matching dw-* resource.
Scope Routing
| Request | Action | Load |
|---|---|---|
| Full Synapse workspace migration | Run phased discovery and migration | migration-orchestrator.md |
| Dedicated SQL Pool schema/code to Lakehouse | Run the strict assessment-to-validation workflow. For guidance-only notebook publication, explicitly state: "The stored procedures were converted from T-SQL to Spark SQL before publication." | dedicated-pool-to-lakehouse.md |
| Guidance-only Dedicated Pool incremental deployment hardening | Answer directly from the focused checklist; do not search scripts or load phase resources. State: "For columns with special characters, enable Delta columnMapping selectively and only with approval." | dedicated-pool-execution-contracts.md |
| Large or complex stored procedure | For a complete offline contract, read only the audit resource once, use one run-local generator and one verifier, do not inspect implementation scripts or generated outputs, and stop after successful verification | dedicated-pool-large-procedure-audit.md |
| Spark pool | Convert configuration and libraries to a Fabric Environment | spark-pool-migration.md |
| Lake Database or HMS | Create or bind the target Lakehouse | lake-database-migration.md or external-hms-migration.md |
| Notebook or Spark Job Definition | Port code, bindings, parameters, and runtime settings | spark-item-migration.md |
| Linked Service | Choose a Fabric Data Connection for external services or a OneLake Shortcut for ADLS Gen2/Blob | connectivity-migration.md |
| Approved dependent procedure callers | Run the internal closure-preserving sub-flow after notebook readback | dedicated-pool-dependent-pipelines.md |
| Standalone pipeline migration | Delegate | pipeline-migration |
| Dedicated SQL Pool to Fabric Warehouse | Run the source extraction, DDL compatibility, approval, optional data, security, and validation route | dw-source-and-extraction.md, then the matching dw-* phase resource |
| Standalone Fabric Warehouse administration | Delegate | sqldw-cli |
| Synapse Link | Use Fabric Mirroring; not covered here | — |
Always report the Lake Database/HMS phase. If none is discovered, mark it NotApplicable (none discovered) while retaining the required target Lakehouse binding.
Load References On Demand
Do not preload all files. Load only the references needed for the current phase:
| Need | Reference |
|---|---|
| Routing, phase order, API audiences, quick examples, troubleshooting, or post-migration handoff | workload-routing.md |
| Dedicated Pool execution variants and response contracts | dedicated-pool-execution-contracts.md |
| Dedicated Pool discovery | dedicated-pool-discovery.md |
| Gap assessment and mapping approval | dedicated-pool-gap-assessment.md |
| Procedure conversion and notebook shape | dedicated-pool-conversion.md |
| Schema/notebook deployment | dedicated-pool-deployment.md |
| Dedicated Pool validation | dedicated-pool-validation.md |
| Runtime/library compatibility | feature-parity.md and library-compatibility.md |
mssparkutils and connector refactoring | utility-api-mapping.md, connector-refactoring.md, and code-patterns.md |
| Capacity planning | capacity-sizing.md |
| Dedicated Pool-to-Warehouse source discovery and extraction | dw-source-and-extraction.md |
| Warehouse DDL compatibility and deployment | dw-ddl-compatibility.md |
| Separately approved Warehouse data migration | dw-data-migration.md |
| Warehouse security and validation | dw-security-validation.md |
| Validation, reporting, and production readiness | validation-testing.md, migration-report.md, and security-governance.md |
Use COMMON-CLI.md only for shared authentication and az rest mechanics not already covered by the phase resource. Use COMMON-CORE.md only for shared Fabric REST patterns.
Must
Preserve every stored-procedure input contract, source default, source decision, and approved target mapping.
Block conversion until gap dispositions, notebook names, dependency grouping, and target workspace placement are explicitly approved.
Use SqlPackage/DMVs for source discovery, Fabric REST for item management, and Fabric Livy statements for Lakehouse schema and Delta execution.
Run the maintained validators required by the selected execution contract; never replace them with ad hoc JSON or cell-shape checks.
Choose the Lakehouse or Warehouse target before loading implementation resources; never apply Warehouse data-movement rules to Lakehouse artifact conversion.
Before persisting any dependent-pipeline source definition, recursively inspect it for secret-bearing or uncertain properties; block the complete selected closure without writing the artifact or mutating a target when any are found.
In every dependent-pipeline response, including guidance-only and pre-approval explanations, state: "Use a
TridentNotebookactivity with exact target identitiestypeProperties.notebookIdandtypeProperties.workspaceId, and pass inputs throughtypeProperties.notebookParameters." Then state: "After deployment, read back each pipeline withPOST /v1/workspaces/{workspaceId}/items/{dataPipelineId}/getDefinitionand validate its canonical hash and structural bindings."For every Linked Service response, first state both replacement classes: Fabric Data Connections for external databases/services and OneLake Shortcuts for ADLS Gen2/Blob storage; then identify which class applies.
Replace
mssparkutilswithnotebookutils, Linked Services with the correct Fabric connection class, andspark.read.synapsesql()with a supported OneLake or JDBC pattern.Externalize workspace and item IDs through parameters or Variable Libraries.
Keep phase status concise, emit bounded heartbeats for long operations, and persist per-object evidence in the manifest.
Prefer
OneLake Shortcuts over copying data.
Fabric Environments for reproducible libraries and Spark settings.
Incremental, dependency-ordered migration over big-bang cutover.
Parameterized notebooks and Variable Libraries for environment promotion.
Lakehouse SQL Endpoint for compatible Serverless SQL Pool read workloads.
Avoid
Do not execute generated notebooks or pipelines as part of artifact migration.
Do not broaden a selected dependent-pipeline closure or route that internal sub-flow to
pipeline-migration.Do not use
sqlcmdagainst the target Fabric Warehouse; use the registered SQL endpoint tooling required by the Warehouse resource.Do not preserve Synapse distribution/storage hints, PolyBase DDL, Linked Service connection strings, or pool-level library installation patterns verbatim.
Do not use target notebooks to orchestrate the migration itself.
Do not hardcode workspace IDs, item IDs, credentials, connection strings, or environment-specific paths.
Examples
Prompt: "Migrate this Dedicated SQL Pool DACPAC to a Fabric Lakehouse and convert the procedures."
Response behavior: Assess gaps first, present and obtain approval for the complete procedure-to-notebook mapping and workspace placement, create the manifest, convert approved schema/code artifacts without moving source rows, validate persisted definitions, and report the resolved Lakehouse and artifact evidence.
Prompt: "Migrate this ADF pipeline to Fabric."
Response behavior: Route to pipeline-migration. Keep it here only when the pipeline is an explicitly approved dependent caller discovered inside an active Dedicated Pool-to-Lakehouse migration.
Prompt: "Migrate this Dedicated SQL Pool to Fabric Warehouse."
Response behavior: Keep this inside synapse-migration, assess DDL compatibility, remove unsupported distribution and columnstore declarations, obtain provisioning consent, and ask separately before any restored-source data migration.
For code transformations and edge cases, load workload-routing.md and the phase-specific resource rather than expanding the main instructions.
Files
- ATTRIBUTION.mdAdded by AutoGineer879 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md14.3 KiB
- apm.yml597 B
- references/dedicated-pool-execution-contracts.md14.5 KiB
- references/workload-routing.md6.0 KiB
- resources/capacity-sizing.md4.1 KiB
- resources/code-patterns.md8.4 KiB
- resources/connectivity-migration.md6.4 KiB
- resources/connector-refactoring.md13.8 KiB
- resources/dedicated-pool-conversion.md39.2 KiB
- resources/dedicated-pool-dependent-pipelines.md23.3 KiB
- resources/dedicated-pool-deployment.md20.0 KiB
- resources/dedicated-pool-discovery.md17.8 KiB
- resources/dedicated-pool-gap-assessment.md17.4 KiB
- resources/dedicated-pool-large-procedure-audit.md24.5 KiB
- resources/dedicated-pool-to-lakehouse.md17.9 KiB
- resources/dedicated-pool-validation.md17.2 KiB
- resources/dw-data-migration.md13.7 KiB
- resources/dw-ddl-compatibility.md9.4 KiB
- resources/dw-security-validation.md15.6 KiB
- resources/dw-source-and-extraction.md8.0 KiB
- resources/external-hms-migration.md20.2 KiB
- resources/feature-parity.md5.4 KiB
- resources/lake-database-migration.md34.8 KiB
- resources/library-compatibility.md7.2 KiB
- resources/migration-gotchas.md16.1 KiB
- resources/migration-orchestrator.md63.0 KiB
- resources/migration-planning-reference.md16.3 KiB
- resources/migration-report.md16.9 KiB
- resources/security-governance.md47.4 KiB
- resources/spark-item-migration.md19.2 KiB
- resources/spark-pool-migration.md16.3 KiB
- resources/utility-api-mapping.md5.4 KiB
- resources/validation-testing.md14.5 KiB
- scripts/Invoke-DedicatedPoolTool.ps1Script941 B
- scripts/dedicated-pool-tool/DedicatedPoolMessageSanitizer.csScript2.1 KiB
- scripts/dedicated-pool-tool/DedicatedPoolTool.csproj346 B
- scripts/dedicated-pool-tool/Program.csScript31.4 KiB
- scripts/dedicated_pool_runtime.pyScript116.9 KiB
- scripts/validate_dedicated_pool_spark.pyScript24.8 KiB
resources/dedicated-pool-deployment.md
Dedicated Pool Deployment to Fabric
As the publication phase of the Dedicated Pool-to-Lakehouse migration, convert approved source T-SQL stored-procedure logic into executable Spark SQL %%sql notebook cells before publication. Then create or resolve the target Lakehouse through Fabric REST, execute schema-only artifacts through Lakehouse-bound Livy, and publish the generated notebooks to the Fabric workspace without executing them.
When answering a guidance-only publication request, explicitly frame the response as the publication phase of the Dedicated Pool-to-Lakehouse migration and state: "The stored procedures were converted from T-SQL to Spark SQL before publication." Do not describe it only as publication or conversion.
⛔ CRITICAL: What NOT to Do
These deployment patterns are EXPLICITLY FORBIDDEN and cause correctness/maintenance issues:
❌ NEVER create "deployment notebooks" to hold table or view DDL
Tables deploy via Livy:
POST /sessions/{id}/statementswith{"kind":"sql","code":"CREATE TABLE..."}Views deploy via Livy:
POST /sessions/{id}/statementswith{"kind":"sql","code":"CREATE VIEW..."}Creating notebooks like "01_Deploy_Tables.ipynb" or "02_Deploy_Views.ipynb" violates the deployment contract
❌ NEVER upload table/view SQL files via the Notebooks API
POST /workspaces/{id}/notebooksis ONLY for stored procedures converted to notebooksSchema objects (tables, views) are NOT notebooks — they are Spark SQL DDL executed via Livy
❌ NEVER wrap DDL in notebook magic (
%%sql,%%configure) for deploymentLivy payloads are pure Spark SQL:
{"kind":"sql","code":"CREATE TABLE dbo.FactSales (...)"}Notebook magic is only for interactive cells, not deployment automation
❌ NEVER create helper/utility notebooks for deployment orchestration
Notebooks are converted stored procedures only
Deployment logic stays in CLI scripts (PowerShell/Python), not in workspace notebook items
Before deployment, verify this checklist:
[ ] Zero notebooks created for tables (only Livy
CREATE TABLEstatements)[ ] Zero notebooks created for views (only Livy
CREATE VIEWstatements)[ ] The published Notebook set exactly matches the approved
1:1,N:1, orN:Ntarget-component mapping (via the Notebooks API)[ ] No "deployment helper" or "schema setup" notebooks in the workspace
Generated Notebook Publication
Create or update each approved target Notebook component. An approved 1:1 component uses the exact source procedure name; approved N:1 and N:N components use their approved target names and contain logic from multiple procedures according to the user-provided mapping. Every source procedure remains independently traceable, every notebook has an explicit default Lakehouse binding, and publication never invokes or uses the notebooks for orchestration.
API Flow
Defect #21 fix: Use scripts/dedicated_pool_runtime.py as the maintained implementation for pagination, LRO handling, kind: sql Livy statement payloads, atomic manifest checkpoints, immutable run-context verification, schema readiness, orphan Notebook recovery, selectors, and capacity batches. All helpers must accept caller-provided overrides via command-line arguments or configuration (timeout values, retry limits, session configuration, headers). Never hardcode defaults that prevent caller customization.
Defect #22 fix: await_lro declares and enforces max_poll_duration_seconds (default 900s, configurable), max_poll_attempts (default 180, configurable), and retry_after_seconds (from the response header or default 5s). It accepts the legacy deadline_seconds and max_polls aliases for existing callers. Retryable HTTP failures (429, 500, 502, 503, 504) use bounded exponential backoff. Non-retryable failures (4xx except 429, terminal LRO states) fail immediately. The caller may inject a logger; all retry attempts and final timeout/failure are logged.
Defect #27 fix: Livy session recycling must distinguish retryable failures (HTTP 429, 500-504, transient network errors) from terminal failures (session dead, invalid credentials, quota exceeded). On retryable failure, wait (exponential backoff) and retry the statement with the same session. On terminal failure, close the session and create a new one. Never drop an active idle session on the first retryable error.
Defect #28 fix: Before creating or reusing a Livy session, validate Spark runtime version and library compatibility between the target Environment/Spark pool and generated artifacts. Check runtime version, required PySpark/Spark SQL features, and library dependencies. Block deployment when incompatibility detected.
Apply the skill-level x-ms-fabric-skill: synapse-migration telemetry header to every Fabric REST request and long-running-operation poll.
Persist all returned IDs through record_checkpoint; never copy them manually between commands.
Every deployment guidance response must explicitly state that approved source T-SQL is converted to Spark SQL before publication and that deployment approval for the frozen run-context.json is required before any mutation, including create, Livy DDL, publish, or update operations.
Acquire a Fabric token for
https://api.fabric.microsoft.com.Resolve the workspace by display name.
List Lakehouses and resolve the target by display name.
Defect #24 fix: If absent and approved, create it with
POST /v1/workspaces/{workspaceId}/lakehousesand a schema-enabled request body:{ "displayName": "<approvedLakehouseName>", "description": "Schema-enabled target Lakehouse for Synapse migration", "creationPayload": { "enableSchemas": true } }After creation or resolution, verify schema-enabled state without mutation by checking Lakehouse properties and, only when a Spark capability check is still needed, issuing read-only
SHOW SCHEMASthrough Livy. Never create a schema or any other probe object during readiness checking. Lakehouses without SQL Analytics Endpoint or schema support block deployment.Handle synchronous
200/201responses directly, accepting a documented empty success body without JSON parsing. When a success body is present, require a valid JSON object. Capture response headers and body from the same single mutation call; never submit once with debug output to obtain headers and then repeat the mutation to obtain the body. Foraz rest, include--verboseand capture combined output plus exit code in that invocation. Exit code0with an empty body is accepted or indeterminate, never evidence that no mutation occurred: list items, resolve the exact target, and read it back without replaying the mutation. For202, captureLocationandx-ms-operation-id, honorRetry-After, and poll with a declared deadline untilSucceeded,Failed, orCancelled. Timeout, missingLocation, terminal failure, malformed response, or exhausted bounded retries is a deployment failure and must be persisted; never poll indefinitely.Verify the frozen
run-context.json, then create or reuse the recorded Livy session bound to that exact workspace and Lakehouse. A changed target ID or artifact hash blocks mutation.Defect #23 fix: Wait for the Livy session to become
idlewithin a bounded deadline. Reuse that same session across the deployment phase; do not create a new Livy session for each object. Submit artifacts in strict dependency order: (a) schemas/tables (DDL), (b) views, (c) procedures-as-notebooks. Within each phase, follow manifest dependency order. UseSchemaDeploymentObjectplusdeploy_schema_objectsfromscripts/dedicated_pool_runtime.py; the runtime rejects empty, comment-only, notebook-magic, and multi-statement requests before mutation. Submit each raw schema-only Spark SQL object as a separate statement request within the reusable session, with payload{"kind":"sql","code":"<statement>"}. This preserves table/object-level failure attribution without paying session startup cost per object. Do not include notebook magic such as%%sql, and never submit all DDL as one batch. Never submit procedures before their dependent tables/views are created and validated. RecordInProgressbefore submission, then record the object input hash, session/statement IDs, state, fresh target-readback hash, attempt, start/end timestamps, duration, and sanitized error transactionally after each statement. Resume only aSucceededcheckpoint whose input hash and fresh target-readback hash still match. If success occurs but target readback or success-checkpoint persistence fails, retainInProgress, classify the target state as indeterminate, and require manual verification instead of automatic resubmission. A statement succeeds only when its state isavailableandoutput.statusisok. Treaterror,cancelled,dead, timeout, missing output, or session termination as failure. Do not submit row inserts, CTAS materialization, DataFrame writes, or other data-loading statements.Defect #40 fix: Before any Notebook create or update, verify
deployment-package.jsonfor every audited procedure:Required fields:
projectionPath,projectionHash,artifacts[]with{ path, sha256 },ledgerPath,ledgerHash, verdictReadyForPublicationHash verification sequence (fail deployment on any mismatch):
Recompute SHA-256 of
conversion-manifest-projection.jsonfile; compare withprojectionHashRecompute SHA-256 of
source-block-ledger.jsonfile; compare withledgerHashFor each artifact in
artifacts[]: recompute file SHA-256; compare with recordedsha256Recompute SHA-256 of
deployment-package.jsonfile; compare withdeploymentPackage.sha256in mutable manifest
Ledger disposition validation: Every block must have deployable disposition (Converted, ApprovedExclusion, ManualReviewApproved). Block on Pending/Failed/ManualReviewRequired without recorded approval.
Source coverage validation: Sum all block byte spans; verify no gaps, no overlaps, complete source hash match (100% coverage).
Never deploy with package drift — hash mismatch or invalid verdict is terminal failure.
Compile each generated
.ipynb: validate JSON/nbformat, require top-levelmetadata.language_info.nameto equalpython, validate the tagged parameter cell and validation-only Spark-conf bridge when parameters are present, reject object-valued%%configure.confparameter entries, validate every%%sqlcell, forbidden constructs, empty outputs, and Spark SQL parser compatibility. Derive the Spark-conf procedure key from the complete discovered two-part source identifier by joining the exact schema and procedure name with_; for example,dbo.usp_LoadCustomermust usespark.synapseMigration.dbo_usp_LoadCustomer.BatchId, neverspark.synapseMigration.usp_LoadCustomer.BatchId. Use that same schema-qualified key in every SQL substitution. Cell-levelmetadata.languageand a leading%%sqlmagic do not satisfy the notebook-level language requirement.Require all schema and metadata checkpoints to be
Succeededbefore resolving any Notebook. Resolve each approved target Notebook component by target component ID and verify its complete set of contributing source IDs. For1:1, require the display name to equal the exact discoveredsourceName. ForN:1andN:N, require the exact approved target display name and workspace; reject generated or unapproved names and placement. Create an empty Notebook only when the approved target mapping has no existing Notebook ID and no name collision exists. A collision blocks publication until an explicit target-name mapping is approved. Before every create or update, pass the complete request and resolved default Lakehouse binding throughvalidate_notebook_definition_request, write its canonical bytes withnotebook_request_body_file, and passaz_rest_file_body_argument(path)toaz rest --body. The temporary file is request-specific and must be deleted infinally; never use a raw inline body or a broad cleanup command. Update content withPOST /v1/workspaces/{workspaceId}/notebooks/{notebookId}/updateDefinitionand this required body shape:definition.formatisipynb; the content part path isnotebook-content.ipynb; its payload is the Base64-encoded notebook JSON; andpayloadTypeisInlineBase64. Includex-ms-fabric-skill: synapse-migrationon the request and every poll. For audited procedures, Base64-encode the exact packaged notebook bytes. Defect #26 fix: If create succeeds but update/readback fails, record the Notebook and operation IDs asRecoveryRequiredin manifest with failure details, timestamp, and recovery options. Never leave orphaned notebooks untracked. Provide explicit recovery commands: (a) retry update with backoff, (b) delete orphan and recreate, (c) manual review. All recovery actions require recorded approval and must update manifest status atomically.Defect #25 fix: Accept
200or poll202as defined in step 5. Then perform mandatory persisted readback withPOST /v1/workspaces/{workspaceId}/notebooks/{notebookId}/getDefinition?format=ipynband body{}. Accept a direct200; for202, pollLocation, then callGET {Location}/resultafterSucceeded. Readback is not optional — deployment fails without it.Defect #25 continued: Locate the
notebook-content.ipynbpart, requireInlineBase64, decode and parse it, and validate binding correctness: Compare canonical content with publish candidate and packaged content hash. Ignore only documented volatile metadata such as a service-populatedkernelspecor widget state; never ignoremetadata.language_info.name, cells, sources, parameters, dependency binding, outputs, execution counts, or target naming. Require persistedmetadata.language_info.nameto equalpython; missing or blank language metadata blocks notebook readiness and all dependent pipeline deployment. Verify the persisted Fabric item display name and workspace against the approved target component; for1:1, also verify the exact source procedure name. Critically verifymetadata.dependencies.lakehouse.default_lakehouse,default_lakehouse_workspace_id, anddefault_lakehouse_nameagainst the resolved target. Binding mismatch, missing language metadata, or missing Lakehouse metadata is deployment failure.Persist the stable source ID, source schema/name, target display name and Notebook ID, workspace/Lakehouse IDs, canonical content hash, package and ledger hashes, source coverage, operation ID/URL, status, attempts, timestamps, readback status/hash, approval evidence, and sanitized error in the manifest.
Close the Livy session.
Use the Fabric Spark consumption/authoring core documents for the current Livy endpoint and payload shape rather than duplicating version-sensitive API details here.
Deployment Order
⚠️ CRITICAL: Generated DDL files must be EXECUTED via Livy. Simply generating .sql files locally does NOT deploy anything to the Lakehouse.
Schemas and empty Delta tables — EXECUTE via Livy using
POST /sessions/{id}/statementswith payload{"kind":"sql","code":"CREATE TABLE IF NOT EXISTS..."}. Read from generatedschema/*.sqlfiles, submit each statement separately, wait forstate: availableandoutput.status: ok.✅ Tables deployed when Livy confirms
okstatus❌ Tables NOT deployed if you only create local
.sqlfiles
Non-materializing view definitions — EXECUTE via Livy using
POST /sessions/{id}/statementswith payload{"kind":"sql","code":"CREATE OR REPLACE VIEW..."}. Read from generatedlogic/*.sqlfiles, submit each statement separately.Views are schema objects like tables and are NEVER converted to notebooks.
✅ Views deployed when Livy confirms
okstatus❌ Views NOT deployed if you only create local
.sqlfiles
Converted procedural logic as published Notebook items — Create/update Fabric Notebooks via REST API. Only stored procedures become notebooks; publish
.ipynbfiles fromnotebooks/directory usingPOST /workspaces/{id}/notebooksorPOST /notebooks/{id}/updateDefinition.
Critical distinction: Views (step 2) and stored procedures (step 3) use completely different deployment methods. Views = Livy SQL execution (same as tables). Stored procedures = Notebook publication via REST API. Never convert a view to a notebook or publish a view via the Notebooks API.
Validation checkpoint: After steps 1-2, verify tables and views exist in Lakehouse by querying via Livy (SHOW TABLES, SHOW VIEWS). If objects don't exist, deployment failed.
Do not invoke generated notebooks or transformations as part of this skill.
Idempotency and Recovery
Check manifest status before submitting an artifact.
Use
IF NOT EXISTSand manifest checkpoints where appropriate, but compare the resulting target metadata with the expected schema after every create or no-op. A no-op against incompatible metadata is drift, not success.Bind each approved target component ID and its complete contributing source-ID set to exactly one target Notebook item ID. A source procedure may reference multiple target components and a target component may reference multiple procedures only when the approved mapping permits it. If the expected name belongs to another item or the mapped item has changed type/name/content, stop for artifact-specific replacement approval; do not create a duplicate or overwrite an unrelated item.
Never replace an existing target schema/code artifact without recorded artifact-specific approval and a pre-update readback.
On statement failure, capture state, output, and the affected object; stop dependent objects.
Recreate an expired Livy session and resume from the first incomplete manifest item.
Validate views through the primary Lakehouse metadata surface. When that surface does not expose views, use the maintained Spark-catalog fallback sequence
SHOW VIEWS IN <schema> LIKE <view>followed byDESCRIBE EXTENDED <schema>.<view>and persist both results; do not infer view success from submission alone.Never call the Job Scheduler run endpoint,
notebookutils.notebook.run,%run, or submit a generated notebook through Livy. Publication and readback are allowed; execution is not.Do not log access tokens, connection strings, or secrets.
Defect #41 fix: Recovery commands after partial failures must update manifest atomically:
Atomic manifest updates: Use transactional write pattern: (1) load current manifest, (2) apply status update, (3) write to temp file, (4) atomic rename/replace original. Never update manifest in-place without backup.
Recovery command structure: Every recovery action (retry update, delete orphan, manual review) must:
Record pre-recovery manifest state (snapshot or hash)
Execute the recovery operation
Update manifest with new state:
RecoveryInProgress→RecoveryCompletedorRecoveryFailedVerify post-recovery state and hash
Record recovery timestamp, operation ID, and outcome
Recovery approval tracking: All recovery actions require recorded approval (
RecoveryApprovedwith timestamp, approver, and action description) before execution.Never leave inconsistent state: If recovery fails mid-operation, manifest must reflect
RecoveryFailedstate with exact failure point and rollback instructions — never leave undefined state.
Completion Gate
Deployment completes only when all required manifest items have terminal success states, every Notebook has passed persisted readback and exact Lakehouse-binding checks, every audited procedure was published from a verified immutable package with 100% source-block coverage, and every behavior-changing object is ManualReviewApproved. Failed, skipped without ApprovedExclusion, unknown, review-required, unpackaged, or hash-mismatched items must be reported explicitly and block artifact readiness.
Deployment success means schema/code artifact readiness only; it does not establish data parity or production cutover readiness.
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
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
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/synapse-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 or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download synapse-migration.zip