git-integration-operations-cli

Automates the Microsoft Fabric Git integration lifecycle through fab api or az rest CLI calls.

1.1k|301|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/microsoft/skills-for-fabric --skill git-integration-operations-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-integration-operations-cli
Source: https://github.com/microsoft/skills-for-fabric/tree/main/plugins/fabric-skills/skills/git-integration-operations-cli
Command: npx skills add https://github.com/microsoft/skills-for-fabric --skill git-integration-operations-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Connecting Microsoft Fabric workspaces to Git and keeping them in sync involves fragile control-plane API calls: long-running operations that return 202, stale workspaceHead values causing 400 errors, tenant admin switches that silently block GitHub sync, and credential setup for service principals. This Skill encodes the correct call sequences, polling loops, and prerequisites so the connect, commit, update, status, and disconnect lifecycle runs reliably from the CLI.

Core Features & Use Cases

  • Full Git lifecycle automation: Connect a workspace to Azure DevOps or GitHub, initialize the sync direction, commit workspace items, update from Git, check sync status, resolve conflicts, and disconnect — all via fab api with an az rest fallback.
  • Service principal and CI/CD automation: Create a Fabric cloud connection holding git credentials (ADO service principal or GitHub PAT) and run headless sync from Azure DevOps pipelines or GitHub Actions using the included templates.
  • Workspace relations (preview): Link a branch workspace to its base workspace so the lineage shows in the Fabric portal.
  • Use Case: A platform engineer wants a GitHub Actions workflow that, on every push to main, updates the downstream Fabric workspace from Git — the Skill provides the exact status-check, conflict-policy, and LRO-polling script to do it safely.

Quick Start

Ask the AI to connect your Fabric workspace to an Azure DevOps or GitHub repository and commit all workspace items to the main branch using the Fabric CLI.

Frequently Asked Questions about git-integration-operations-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a Microsoft Fabric workspace to Git from the CLI?

Run fab auth login, then POST to workspaces/{id}/git/connect with the gitProviderDetails (Azure DevOps or GitHub), followed by git/initializeConnection with PreferWorkspace or PreferRemote. The target directory must already exist on the branch, and the caller needs workspace Admin.

How do I automate Fabric Git sync with a service principal?

Create a Fabric cloud connection storing the git credentials (ADO service principal or GitHub PAT) via POST /v1/connections, then pass its id as connectionId in the myGitCredentials block of the connect call. The service principal must be workspace Admin and the tenant must allow service principals to create connections.

Why does updateFromGit fail with 400 WorkspaceHeadMismatch?

The workspaceHead value passed to updateFromGit is stale. Always read git/status immediately before the call and pass the current workspaceHead and remoteCommitHash, since any intervening commit or sync invalidates previously read values.

Does Fabric Git integration support GitHub repositories?

Yes, GitHub and GitHub Enterprise are supported alongside Azure DevOps, but GitHub requires a Personal Access Token stored in a configured connection and has no automatic credential mode. The GitHub sync tenant switch is off by default and must be enabled by a tenant admin first.

Why does my Fabric Git operation seem to hang or never finish?

commitToGit, updateFromGit, and even git/status can return HTTP 202 as long-running operations. Capture x-ms-operation-id from the response headers and poll operations/{id} until status is Succeeded, then confirm workspaceHead equals remoteCommitHash in git/status.

What is out of scope for the Fabric Git integration API?

Stage promotion belongs to deployment pipelines, and branch switching, fab deploy, fabric-cicd, and cross-workspace rebinding are separate concerns. Whether item references rebind after promotion depends on the item definition format (logical vs object IDs), not the Git lifecycle.