AgentSkillsCN

Fabric Notebook Publish

Fabric Notebook发布

SKILL.md

Fabric Notebook Publish Skill

Domain: Microsoft Fabric Notebook DevOps Version: 2.0.0 Status: Active


Overview

This skill enables seamless notebook publishing from VS Code to Microsoft Fabric via Azure DevOps Git integration. It provides change detection, automated CHANGELOG tracking, prerequisite validation, and selective sync capabilities.

Activation Triggers

  • "push to fabric", "sync to fabric", "publish notebook"
  • "fabric notebooks", "notebook deployment"
  • "sync notebooks", "deploy notebooks"
  • "fabric git", "ADO worktree"
  • "changelog", "track notebook changes"

Architecture

mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#cce5ff', 'primaryTextColor': '#333', 'lineColor': '#666', 'edgeLabelBackground': '#fff'}}}%%
flowchart LR
    subgraph LOCAL["VS Code"]
        NB[Notebooks]
        SCRIPT[Sync-ToFabric.v2.ps1]
    end

    subgraph GIT["Git"]
        WT[Worktree]
        ADO[Azure DevOps]
    end

    subgraph CLOUD["Fabric"]
        WS[Workspace]
        API[REST API]
    end

    NB --> |Copy changed| WT
    WT --> |Push| ADO
    SCRIPT --> |Sync| API
    ADO --> |Git Integration| WS

    style LOCAL fill:#cce5ff,stroke:#4a90d9,color:#333
    style GIT fill:#e6d5f2,stroke:#8b6eb3,color:#333
    style CLOUD fill:#b3d9ff,stroke:#4a90d9,color:#333

Fishbowl Color Palette

Use these pastel colors for diagrams:

PurposeFillStroke
Primary#cce5ff#4a90d9
DevOps#e6d5f2#8b6eb3
Success#c2f0d8#4db37d
Warning#fff3b3#d4a849
Critical#ffcccc#cc6666

Workflow Options

ScriptPurposeBest For
Sync-ToFabric.v2.ps1Git-based with change detection + CHANGELOGProduction
Publish-ToFabric.ps1Direct API publish (bypasses Git)Dev iteration
ManualCopy → commit → push → portal syncFallback

Key Features

Change Detection

  • MD5 hash comparison between source and worktree
  • Only syncs notebooks with actual changes
  • Supports filter patterns: -NotebookFilter "*Bronze*"

CHANGELOG Tracking

  • Auto-appends entry to CHANGELOG.Notebook
  • Records: timestamp, user, commit message, changed notebooks
  • Location: Fabric/Utilities/CHANGELOG.Notebook/notebook-content.py

Prerequisite Validation

  • Checks Az module installed
  • Validates Azure login
  • Confirms worktree exists
  • Verifies Git remote configured

Configuration

All settings in fabric-governance/scripts/fabric-publish/fabric-publish.config.json:

json
{
  "workspace": {
    "id": "c89fa577-76cf-461d-bff9-cd87f64f9d62",
    "name": "XODO Data Engineering"
  },
  "git": {
    "adoRemoteName": "fabric",
    "branch": "FishBowl",
    "worktreeRelativePath": "../../../../FishBowl-Fabric"
  },
  "changelog": {
    "enabled": true
  }
}

Command Reference

Sync v2 (Recommended)

powershell
cd fabric-governance\scripts\fabric-publish

# Sync changed notebooks
.\Sync-ToFabric.v2.ps1 -CommitMessage "Update Bronze layer"

# Filter by pattern
.\Sync-ToFabric.v2.ps1 -NotebookFilter "*Bronze*" -CommitMessage "Bronze fixes"

# Preview (no changes)
.\Sync-ToFabric.v2.ps1 -DryRun

# Force sync all
.\Sync-ToFabric.v2.ps1 -Force -CommitMessage "Re-sync all"

# Git only (skip Fabric API)
.\Sync-ToFabric.v2.ps1 -SkipApi -CommitMessage "Stage for review"

Direct Publish (Dev Only)

powershell
.\Publish-ToFabric.ps1 -NotebookName "ArchiveData" `
    -NotebookPath "..\..\notebooks\Fabric\Data Engineering\Notebooks\Bronze_Layer\ArchiveData.Notebook\notebook-content.py"

First-Time Setup

powershell
# From repo root
git remote add fabric https://xodo-team.visualstudio.com/XODO/_git/XODO
git fetch fabric FishBowl
git worktree add ../FishBowl-Fabric fabric/FishBowl
cd ../FishBowl-Fabric
git checkout -b FishBowl --track fabric/FishBowl

Error Handling

ErrorSolution
Worktree not foundRun first-time setup
Not logged into AzureConnect-AzAccount
Az module not installedInstall-Module -Name Az
401 UnauthorizedRe-run Connect-AzAccount
403 ForbiddenCheck workspace Admin/Member role
Sync conflictResolve in Fabric portal

Synapses

Related Files

FilePurpose
Sync-ToFabric.v2.ps1Main sync script
Publish-ToFabric.ps1Direct API publish
fabric-publish.config.jsonConfiguration
NOTEBOOK-PUBLISH-TO-FABRIC.mdUser guide
FABRIC-PUBLISH-WORKFLOW.mdWorkflow comparison