[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699RE4SAE2CCPERSY11BV1G":3,"skill-same:01M699RE4SAE2CCPERSY11BV1G":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M699RE4SAE2CCPERSY11BV1G","git-integration-operations-cli",null,"Runs the Fabric Git integration lifecycle through fab api or az rest, including connecting a workspace to Azure DevOps or GitHub, committing, updating from Git, reading sync status, resolving conflicts, disconnecting a connected workspace, and automating sync with a service principal. For stage promotion use deployment-pipelines-authoring-cli. Branch switching, fab deploy, fabric-cicd and cross-workspace rebinding are out of scope.","microsoft\u002Fskills-for-fabric","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699NAPJKS2WBHHDN86Q5MM6",1353,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fgit-integration-operations-cli\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"git integration operations cli","cli","git","operations","integration","promotion","azure","lifecycle","deployment","for","authoring","reading","conflicts","api","switching","scope","branch","sync","azure devops","status","2026-11-10 10:12:30",false,"---\nname: git-integration-operations-cli\ndescription: \"Runs the Fabric Git integration lifecycle through fab api or az rest, including connecting a workspace to Azure DevOps or GitHub, committing, updating from Git, reading sync status, resolving conflicts, disconnecting a connected workspace, and automating sync with a service principal. For stage promotion use deployment-pipelines-authoring-cli. Branch switching, fab deploy, fabric-cicd and cross-workspace rebinding are out of scope.\"\nmetadata:\n  maturity: experimental\n  owner: yaron\n---\n\n> **Telemetry — MANDATORY.** Every `api.fabric.microsoft.com` call must carry\n> `x-ms-fabric-skill: git-integration-operations-cli` (`az rest`: `--headers \"x-ms-fabric-skill=git-integration-operations-cli\"`),\n> including every LRO poll, `fabric_lro` and retry. Snippets omit it — add it anyway.\n\n> **CRITICAL NOTES**\n> 1. To find a workspace ID from its name: list all workspaces, then filter by\n>    `displayName` with JMESPath. To find an item ID: list items of that type in the\n>    workspace, then filter by `displayName`.\n> 2. All Git operations are **control plane** calls against\n>    `https:\u002F\u002Fapi.fabric.microsoft.com`. Run `fab auth login` once and `fab api`\n>    sets the base URL and Fabric token audience automatically. With the `az rest`\n>    fallback you must pass the matching `--resource` yourself, or you get a 401.\n> 3. `commitToGit`, `updateFromGit`, and even `git\u002Fstatus` can return **HTTP 202\n>    (long-running operation)**, not just a synchronous body. On `202`, poll the\n>    operation: with `fab`, read `x-ms-operation-id` from `--show_headers` and poll\n>    `fab api operations\u002F{id}` until `status` is `Succeeded`; with the `az rest`\n>    fallback, poll the `Location` \u002F `x-ms-operation-id` header (see COMMON-CORE\n>    long-running operation polling). When a `202` came from `git\u002Fstatus` itself,\n>    read its body from `operations\u002F{id}\u002Fresult` (the `git_status` helper does\n>    this); calling `git\u002Fstatus` again can just return another `202`. After a\n>    `commitToGit` \u002F `updateFromGit` operation succeeds, read status with\n>    `git_status` to confirm `workspaceHead == remoteCommitHash`, and do not act\n>    on its `changes` until the heads match. (Learn: rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit and\n>    fabric\u002Fcicd\u002Fgit-integration\u002Fgit-automation.)\n> 4. `updateFromGit` requires the workspace's **current** `workspaceHead`; a stale\n>    value returns `400 WorkspaceHeadMismatch`. Always read `git\u002Fstatus` first.\n> 5. **Prerequisites for every Git operation:** the workspace must be assigned to a\n>    **capacity** (an unassigned workspace fails with `WorkspaceHasNoCapacityAssigned`),\n>    and the caller (user or service principal) must hold the right workspace\n>    role: **connect and disconnect require Admin**; **commit and update require at\n>    least Contributor** with write permission on all items; **branch switching\n>    requires Admin** (or Contributor when the workspace opt-in setting *Allow users\n>    with at least Contributor role to change Git branch* is on). Only one Git\n>    operation may run against a workspace at a time.\n> 6. **Tenant admin switches** gate Git integration and are a common cause of an\n>    unexplained failure. The **GitHub** sync switch is **off by default** (enable it\n>    before any GitHub connect); Azure DevOps sync is on by default. Cross-region\n>    workspace-to-*Azure*-repo needs the **cross-geo export** switch (GitHub does not\n>    enforce it). See [references\u002Fgit-integration-concepts.md § Tenant admin prerequisites](references\u002Fgit-integration-concepts.md#tenant-admin-prerequisites).\n\n# Git Integration Operations — CLI Skill\n\nAutomate the Fabric Git integration lifecycle (connect, commit, update, status,\ndisconnect) from CLI environments. Whether cross-workspace item references rebind\nafter promotion is a separate concern, determined by the item definition format\n(logical vs object IDs) rather than the Git lifecycle itself.\n\n## Prerequisite Knowledge\n\nRead these shared references first (paths assume this skill lives under\n`skills\u002Fgit-integration-operations-cli\u002F` in `skills-for-fabric`; adjust when drafting\noutside the repo):\n\n- [COMMON-CLI.md § Finding Workspaces and Items in Fabric](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#finding-workspaces-and-items-in-fabric) — **Mandatory** for resolving workspace\u002Fitem IDs by name.\n- [COMMON-CORE.md § Authentication & Token Acquisition](..\u002F..\u002Fcommon\u002FCOMMON-CORE.md#authentication--token-acquisition) — wrong audience = 401; read before any auth issue.\n- [COMMON-CLI.md § Authentication Recipes](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#authentication-recipes) — `az login` flows and token acquisition for CLI.\n- [COMMON-CLI.md § Fabric Control-Plane API via az rest](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#fabric-control-plane-api-via-az-rest) — the `az rest` **fallback** path (**always pass `--resource`**); includes LRO polling helpers.\n- [COMMON-CORE.md § Core Control-Plane REST APIs](..\u002F..\u002Fcommon\u002FCOMMON-CORE.md#core-control-plane-rest-apis) — pagination, long-running-operation polling, rate limiting.\n\n## Table of Contents\n\n| Task | Reference |\n|---|---|\n| Pre-flight checks before connecting | [SKILL.md § Pre-Flight (before you connect)](#pre-flight-before-you-connect) |\n| Connect a workspace to Git | [SKILL.md § Connect a Workspace to Git](#connect-a-workspace-to-git) |\n| Create a git connection (service principal) | [SKILL.md § Create the Git provider connection (service principal)](#create-the-git-provider-connection-service-principal) |\n| Commit workspace items to Git | [SKILL.md § Commit to Git](#commit-to-git) |\n| Update a workspace from Git | [SKILL.md § Update from Git](#update-from-git) |\n| Check sync status | [SKILL.md § Check Sync Status](#check-sync-status) |\n| Resolve update conflicts | [SKILL.md § Resolve Conflicts](#resolve-conflicts) |\n| Disconnect from Git | [SKILL.md § Disconnect from Git](#disconnect-from-git) |\n| Link a branch workspace to its base (workspace relations) | [SKILL.md § Link a Branch Workspace to its Base (Workspace Relations)](#link-a-branch-workspace-to-its-base-workspace-relations) |\n| Git integration concepts (sync model, status, permissions) | [references\u002Fgit-integration-concepts.md § Concepts](references\u002Fgit-integration-concepts.md#concepts) |\n| Tenant admin prerequisites (switches) | [references\u002Fgit-integration-concepts.md § Tenant admin prerequisites](references\u002Fgit-integration-concepts.md#tenant-admin-prerequisites) |\n| Supported Git providers | [references\u002Fgit-integration-concepts.md § Supported Git providers](references\u002Fgit-integration-concepts.md#supported-git-providers) |\n| Supported item types | [references\u002Fgit-integration-concepts.md § Supported item types](references\u002Fgit-integration-concepts.md#supported-item-types) |\n| Avoiding formatting-only diffs (trailing newline \u002F line endings) | [references\u002Fgit-integration-concepts.md § Avoiding formatting-only diffs](references\u002Fgit-integration-concepts.md#avoiding-formatting-only-diffs) |\n| Service principal \u002F CI-CD pipeline templates | [references\u002Fautomation-templates.md](references\u002Fautomation-templates.md) |\n| Gotchas, Rules, Troubleshooting | [SKILL.md § Gotchas, Rules, Troubleshooting](#gotchas-rules-troubleshooting) |\n\n## Must\u002FPrefer\u002FAvoid\n\n### MUST DO\n- Read `git\u002Fstatus` and pass the current `workspaceHead` into every `commitToGit`\n  and `updateFromGit` call.\n- Generate a meaningful `commitToGit` comment of at most 300 characters. If the\n  requested text is longer, rewrite it concisely before the API call while\n  preserving intent; do not silently cut it mid-sentence. Retry once, with a\n  rewritten comment strictly shorter than the rejected one, only when Fabric\n  explicitly reports a comment-length validation error.\n- Poll `git\u002Fstatus` after each async operation until\n  `workspaceHead == remoteCommitHash` **and** the `changes` array is empty. A\n  `202`\u002F`Succeeded` status is not proof of a correct sync — validate the state.\n- Deploy an item together with the items it references in the same commit, so\n  logical IDs can resolve inside the target workspace.\n\n### MUST NEVER\n- Never run two Git operations concurrently on the same workspace — a second\n  `commitToGit`\u002F`updateFromGit` while one is still `Running` corrupts head\n  tracking. Serialize: poll the first to `Succeeded` before starting the next.\n- Never treat a workspace as both a source of truth **and** a CI\u002FCD push target\n  on the same branch. Pick one writer per branch: either humans commit from the\n  workspace, or automation pushes to Git — not both at once.\n\n### PREFER\n- `fab api` (after `fab auth login`) as the **primary** driver: it sets the base\n  URL and Fabric token audience automatically, avoiding the 401 wrong-audience\n  trap. Use `az rest` with `--resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"` as the\n  **fallback** when `fab` is unavailable or you need fine-grained header control.\n- `PreferRemote` conflict resolution for a clean \"pull latest from Git\" into a\n  downstream\u002Ftarget workspace.\n\n### AVOID\n- Reusing a stale `workspaceHead` (causes `400 WorkspaceHeadMismatch`).\n- Passing request bodies via stdin to `fab api` (use `-i \u003Cfile.json>` or `-i '\u003Cinline JSON>'`).\n\n---\n\n## CLI: `fab` primary, `az rest` fallback\n\nEvery operation below is shown with `fab api`. Run `fab auth login` once (it\nsupports service principals for automation); `fab` then handles the base URL and\ntoken audience for you. The identical call on the `az rest` fallback is a\nmechanical translation:\n\n**Authenticate `fab` for the identity you are running as:**\n\n```bash\nfab auth login                                              # interactive user (SSO)\nfab auth login -u \u003Cclient-id> -p \u003Cclient-secret> --tenant \u003Ctenant-id>   # service principal (CI\u002FCD)\nfab auth login --identity                                   # managed identity (Azure compute)\n```\n\nA service principal or managed identity must be workspace **Admin** to connect or\ndisconnect (at least **Contributor** with write on all items is enough for\ncommit\u002Fupdate) and (for the `ConfiguredConnection` path) hold the git provider\ncredentials. See\n[references\u002Fautomation-templates.md](references\u002Fautomation-templates.md) for full\npipeline scripts.\n\n- `fab api \u003Cendpoint>` becomes `az rest --method GET --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002F\u003Cendpoint>\" --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"`.\n- `fab api -X post \u003Cendpoint> -i body.json` adds `--method POST --headers \"Content-Type=application\u002Fjson\" --body @body.json`.\n\n`fab api` reads a request body via `-i` from either a file path or an inline JSON\nstring (e.g. `-i '{\"displayName\":\"...\"}'`) — never from stdin. It prints\n`{\"status_code\": \u003Ccode>, \"text\": \u003Cparsed body>}` (add `--show_headers` for a\ntop-level `headers` object), so read response fields with `jq -r '.text.\u003Cfield>'`\nand the LRO id with `jq -r '.headers[\"x-ms-operation-id\"]'`. See\n[Example 2](#example-2-az-rest-fallback-equivalents) for a full `az rest` pair.\n\n---\n\n## Pre-Flight (before you connect)\n\nRun these Git-relevant checks in order before `git\u002Fconnect`. Each failure has a\nspecific fix — resolving them up front avoids the most common connect-time errors.\n\n| Check | Command | Pass = proceed \u002F Fail = fix |\n|---|---|---|\n| Auth + Fabric token | `fab auth login` then `fab api workspaces` | `401` → re-login (`fab` sets the correct audience automatically) |\n| Caller is workspace Admin | `fab api \"workspaces\u002F${WORKSPACE_ID}\u002FroleAssignments\"` | Connect\u002Fdisconnect require the **Admin** role |\n| Workspace has capacity | `fab api \"workspaces\u002F${WORKSPACE_ID}\"` → check `capacityId` | `WorkspaceHasNoCapacityAssigned` → assign a capacity (Git requires one) |\n| Git credential for the SP path | `fab api connections` (reuse if one already fits) | SP connect needs a `ConfiguredConnection`. If none exists, the skill **creates** it from your ADO org\u002Fproject\u002Frepo + SP tenant\u002Fclient\u002Fsecret — see [Create the Git provider connection](#create-the-git-provider-connection-service-principal) (needs the tenant toggle \"service principals can create connections\"). The interactive-user SSO path uses `Automatic` and needs no connection. |\n| Target `directoryName` exists on the branch | GitHub: `curl -fsS -H \"Authorization: Bearer $PAT\" \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcontents\u002F$DIR?ref=$BRANCH\"` — ADO: Items API on the repo | The API (unlike the portal) does **not** create a missing folder — connecting to a `directoryName` that doesn't exist fails with `404 GitProviderResourceNotFound`. If the folder is new, pre-create it first (see the note under [Connect a Workspace to Git](#connect-a-workspace-to-git)). |\n\n## Connect a Workspace to Git\n\nConnect a workspace to an Azure DevOps or GitHub repo, then initialize the\nconnection to establish the sync direction.\n\n```bash\n# 1. Connect (Azure DevOps example). Body goes in a file, passed with -i.\ncat > connect.json \u003C\u003C'JSON'\n{\n  \"gitProviderDetails\": {\n    \"gitProviderType\": \"AzureDevOps\",\n    \"organizationName\": \"myorg\",\n    \"projectName\": \"MyProject\",\n    \"repositoryName\": \"fabric\",\n    \"branchName\": \"main\",\n    \"directoryName\": \"\u002Fworkspace-a\"\n  }\n}\nJSON\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fconnect\" -i connect.json\n\n# 2. Initialize the connection (choose which side wins on first sync)\nprintf '{\"initializationStrategy\":\"PreferWorkspace\"}' > init.json\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FinitializeConnection\" -i init.json\n```\n\nUse `PreferWorkspace` when the workspace already has the authoritative items;\n`PreferRemote` when the Git branch is authoritative.\n\n> **The target `directoryName` must already exist on the branch.** Unlike the Fabric\n> portal — which silently creates a missing folder by committing a `README.md`\n> placeholder into it — the `git\u002Fconnect` **API does not create the folder**.\n> Connecting to a `directoryName` that does not exist on the branch fails with\n> `404 GitProviderResourceNotFound`. The repo and branch must exist too (connect\n> never creates a branch). If the folder is new, create it first by committing a\n> placeholder file to the branch **through the Git provider's API** (not a Fabric\n> API), then connect. Match the portal's convention with a `README.md` whose body is\n> `This is an auto-created file via Fabric skills for \u003Cworkspace-name>`.\n>\n> ```bash\n> # GitHub: create \u003CDIR>\u002FREADME.md on \u003CBRANCH> (reuse the PAT behind the Git connection)\n> DIR=\"workspace-a\"; WS_NAME=\"My Workspace\"\n> CONTENT=$(printf 'This is an auto-created file via Fabric skills for %s\\n' \"$WS_NAME\" | base64)\n> cat > mkfolder.json \u003C\u003CJSON\n> { \"message\": \"Create ${DIR} folder for Fabric Git connect\", \"branch\": \"${BRANCH}\", \"content\": \"${CONTENT}\" }\n> JSON\n> curl -fsS -X PUT -H \"Authorization: Bearer ${GITHUB_PAT}\" \\\n>   \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F${OWNER}\u002F${REPO}\u002Fcontents\u002F${DIR}\u002FREADME.md\" -d @mkfolder.json\n> # Azure DevOps equivalent: POST ...\u002F_apis\u002Fgit\u002Frepositories\u002F${REPO}\u002Fpushes with an\n> # \"add\" change for \"\u002F${DIR}\u002FREADME.md\" on refs\u002Fheads\u002F${BRANCH} (same body content).\n> ```\n\n> **Two authentication modes (both providers use `myGitCredentials` for automation).**\n> A workspace authenticates to git in one of two ways:\n> - **Automatic git credential** (Azure DevOps only): the connecting user's SSO\n>   identity, established from workspace settings. Secondary contributors with at\n>   least Contributor reuse it. Not available for GitHub, and not usable for\n>   headless \u002F service-principal automation.\n> - **Configured credential** (Azure DevOps *and* GitHub): a Fabric cloud connection\n>   referenced in the connect body. This is the required path for any service\n>   principal or unattended run:\n>   ```json\n>   \"myGitCredentials\": { \"source\": \"ConfiguredConnection\", \"connectionId\": \"\u003Cconnection-guid>\" }\n>   ```\n>   For **Azure DevOps**, the connection's `credentialType` can be either\n>   `ServicePrincipal` (headless automation) or `OAuth2` (a stored delegated user\n>   token); both are valid ConfiguredConnection credentials per the Create Connection\n>   API and both support multitenant scenarios.\n>   For **GitHub**, connecting a workspace **requires a Personal Access Token (PAT)**:\n>   the cloud connection stores a fine-grained token with Contents Read (plus Write\n>   to commit), or a classic token with the `repo` scope. GitHub has no automatic\n>   credential mode, so a PAT is mandatory even for an interactive user connect.\n> The distinction is not \"GitHub needs credentials, ADO does not\". ADO *also*\n> requires a ConfiguredConnection whenever a service principal drives the connect;\n> the automatic mode only covers interactive user SSO. (Learn:\n> fabric\u002Fcicd\u002Fgit-integration\u002Fautomate-git-integration-with-service-principal;\n> rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit\u002Fconnect.)\n\n> **Handle the initialize response.** `initializeConnection` returns\n> `requiredAction` (`UpdateFromGit`, `CommitToGit`, or `None`) plus `workspaceHead`\n> and `remoteCommitHash`, and can itself return `202`. After it settles, call the\n> sync operation named by `requiredAction` with the returned hashes, or the\n> workspace stays connected but not fully synced. (Learn:\n> rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit\u002Finitialize-connection.)\n\n### Create the Git provider connection (service principal)\n\nFor unattended automation, first create a Fabric cloud connection that stores the\ngit provider credentials, then pass its `id` as the `connectionId` in the\n`myGitCredentials` block above. Use the\n[Create Connection API](https:\u002F\u002Flearn.microsoft.com\u002Frest\u002Fapi\u002Ffabric\u002Fcore\u002Fconnections\u002Fcreate-connection)\n(`POST \u002Fv1\u002Fconnections`, delegated scope `Connection.ReadWrite.All`). A service\nprincipal can create the connection only if the Fabric admin setting \"service\nprincipals can create workspaces, connections, and deployment pipelines\" is on.\n\n**Information you must supply (Azure DevOps):**\n- ADO **organization**, **project**, and **repository** names, combined into one\n  `url` parameter: `https:\u002F\u002Fdev.azure.com\u002F\u003Corg>\u002F\u003Cproject>\u002F_git\u002F\u003Crepo>\u002F`\n- The service principal's **tenant ID**, **client (application) ID**, and\n  **client secret**\n- A connection **display name** (max 200 chars, must be unique in the tenant)\n\n**Prerequisites before the connection will work:** grant the service principal\n(a) access to that **Azure DevOps organization and project** (git access is\nenforced by ADO itself, not only by Fabric), and (b) **Admin** on the target\nFabric workspace.\n\n```bash\n# Create an Azure DevOps source-control connection using a service principal.\n# The body holds a cleartext SP secret, so restrict perms and delete it on exit\n# (a leftover connection.json can be captured by a later CI step or artifact upload).\ntrap 'rm -f connection.json' EXIT\numask 077\ncat > connection.json \u003C\u003C'JSON'\n{\n  \"displayName\": \"ado-sp-fabric-cicd\",\n  \"connectivityType\": \"ShareableCloud\",\n  \"connectionDetails\": {\n    \"type\": \"AzureDevOpsSourceControl\",\n    \"creationMethod\": \"AzureDevOpsSourceControl.Contents\",\n    \"parameters\": [\n      { \"dataType\": \"Text\", \"name\": \"url\",\n        \"value\": \"https:\u002F\u002Fdev.azure.com\u002F\u003Corg>\u002F\u003Cproject>\u002F_git\u002F\u003Crepo>\u002F\" }\n    ]\n  },\n  \"credentialDetails\": {\n    \"credentials\": {\n      \"credentialType\": \"ServicePrincipal\",\n      \"tenantId\": \"\u003Ctenant-id>\",\n      \"servicePrincipalClientId\": \"\u003Cclient-id>\",\n      \"servicePrincipalSecret\": \"\u003Cclient-secret>\"\n    }\n  }\n}\nJSON\nfab api -X post \"connections\" -i connection.json\n```\n\nThe `201` response returns the connection `id`; use it as `connectionId` in the\n`myGitCredentials` block of the connect call. For a fully secret-free variant,\npass the body inline with `-i '{...}'` (no file on disk) or reference a Key Vault\nsecret via `servicePrincipalSecretReference` instead of the raw\n`servicePrincipalSecret`. The example above uses\n`credentialType: \"ServicePrincipal\"`; Azure DevOps connections also accept\n`credentialType: \"OAuth2\"` (a stored delegated user token), and both credential\ntypes support multitenant scenarios. To switch an *existing* user-connected\nworkspace to a service principal, add the SP as workspace Admin, share or recreate\nthis connection, then\n`PATCH \u002Fworkspaces\u002F{id}\u002Fgit\u002FmyGitCredentials` with the same ConfiguredConnection\nbody. (Learn:\nfabric\u002Fcicd\u002Fgit-integration\u002Fautomate-git-integration-with-service-principal;\nrest\u002Fapi\u002Ffabric\u002Fcore\u002Fconnections\u002Fcreate-connection.)\n\n## Commit to Git\n\nPush workspace items to the connected branch. Read the head first, then commit.\nThe optional `comment` becomes the Git commit message and has a 300-character\nmaximum. Generate or semantically condense it to fit before the first request.\nIf there is no useful comment, omit the field and let the Git provider supply\nits default.\n\nThese helpers are the canonical pattern for every snippet in this skill and in\n[references\u002Fautomation-templates.md](references\u002Fautomation-templates.md):\n\n```bash\n# Read one response header case-insensitively from a `fab api --show_headers` result.\nhdr() { jq -r --arg h \"$1\" '[(.headers \u002F\u002F {}) | to_entries[]\n  | select(.key | ascii_downcase == $h) | .value][0] \u002F\u002F empty'; }\n\n# Run `fab api` and require a parseable {status_code,text} envelope.\nfab_json() {\n  local r\n  r=$(fab api \"$@\" -H \"x-ms-fabric-skill=git-integration-operations-cli\" --show_headers 2>\u002Fdev\u002Fnull) || true\n  jq -e 'has(\"status_code\")' >\u002Fdev\u002Fnull 2>&1 \u003C\u003C\u003C\"$r\" \\\n    || { echo \"fab api $*: no parseable response\" >&2; return 1; }\n  printf '%s\\n' \"$r\"\n}\n\n# Poll an LRO (~10 min bound). Check the HTTP status before the body, honour\n# Retry-After on 429\u002F503, and fail on any other non-200. With \"result\", print the\n# completed operation's body from operations\u002F{id}\u002Fresult.\nwait_for_lro() {\n  local op=\"$1\" want=\"${2:-}\" r sc st=\"\" delay i\n  [ -n \"$op\" ] && [ \"$op\" != \"null\" ] \\\n    || { echo \"wait_for_lro: missing x-ms-operation-id\" >&2; return 1; }\n  for i in $(seq 1 120); do\n    r=$(fab_json \"operations\u002F${op}\") || return 1\n    sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n    delay=$(hdr retry-after \u003C\u003C\u003C\"$r\"); [[ \"$delay\" =~ ^[0-9]+$ ]] || delay=5\n    case \"$sc\" in\n      200) ;;\n      429|503) sleep \"$delay\"; continue ;;\n      *) echo \"LRO ${op}: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n    esac\n    st=$(jq -r '.text.status' \u003C\u003C\u003C\"$r\")\n    case \"$st\" in\n      Succeeded)\n        [ \"$want\" = \"result\" ] || return 0\n        r=$(fab_json \"operations\u002F${op}\u002Fresult\") || return 1\n        [ \"$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\" = \"200\" ] \\\n          || { echo \"LRO ${op}: result HTTP $(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\" >&2; return 1; }\n        jq -c '.text' \u003C\u003C\u003C\"$r\"; return 0 ;;\n      Failed|Undefined) echo \"LRO ${op}: ${st}\" >&2; jq '.text.error' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n    esac\n    sleep \"$delay\"\n  done\n  echo \"LRO ${op}: timed out (last status: ${st:-unknown})\" >&2; return 1\n}\n\n# Print the git\u002Fstatus body. A 202 is resolved from the LRO result, never by\n# calling git\u002Fstatus again (which can return another 202).\ngit_status() {\n  local r sc\n  r=$(fab_json \"workspaces\u002F$1\u002Fgit\u002Fstatus\") || return 1\n  sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n  case \"$sc\" in\n    200) jq -c '.text' \u003C\u003C\u003C\"$r\" ;;\n    202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$r\")\" result ;;\n    *)   echo \"git\u002Fstatus: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n  esac\n}\n\n# Write a commit body to stdout. Fails on a missing head or a comment over 300\n# UTF-16 code units (the service count; jq `length` undercounts emoji).\nbuild_commit_body() {\n  jq -en --arg head \"$1\" --arg msg \"$2\" '\n    def u16: [explode[] | if . > 65535 then 2 else 1 end] | add \u002F\u002F 0;\n    if ($head | length) == 0 or $head == \"null\" then\n      error(\"workspaceHead must be non-empty and non-null.\")\n    elif ($msg | u16) > 300 then\n      error(\"Commit comment must be 300 characters or fewer.\")\n    else\n      {mode:\"All\", workspaceHead:$head}\n      + if ($msg | length) > 0 then {comment:$msg} else {} end\n    end'\n}\n\n# Returns 0 committed, 3 service rejected the comment length, 1 any other failure.\ncommit_to_git() {\n  local r sc\n  r=$(fab_json -X post \"workspaces\u002F$1\u002Fgit\u002FcommitToGit\" -i \"$2\") || return 1\n  sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n  case \"$sc\" in\n    200) return 0 ;;\n    202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$r\")\"; return ;;\n    400)\n      if jq -e '.text | tostring | ascii_downcase\n          | test(\"comment\") and test(\"300|length\")' >\u002Fdev\u002Fnull \u003C\u003C\u003C\"$r\"; then\n        echo \"commitToGit: comment too long\" >&2; return 3\n      fi ;;\n  esac\n  echo \"commitToGit: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1\n}\n```\n\nCommit all pending changes:\n\n```bash\nSTATUS=$(git_status \"$WORKSPACE_ID\") || exit 1\nHEAD=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$STATUS\")\nCOMMIT_MSG=\"Author items\"\nbuild_commit_body \"$HEAD\" \"$COMMIT_MSG\" > commit.json || { rm -f commit.json; exit 2; }\nrc=0; commit_to_git \"$WORKSPACE_ID\" commit.json || rc=$?\nexit \"$rc\"\n```\n\nExit `2` means the request was never sent: fix the head or condense the comment.\nExit `3` means Fabric rejected the comment length: rewrite it strictly shorter\nthan the rejected comment (resending the same text gets the same `400`) and run\nthe commit once more. Treat any other non-zero exit as a failure and do not retry it\nas a length problem. Use `\"mode\": \"Selective\"` with an `items` array to commit a\nsubset.\n\n## Update from Git\n\nPull committed items into a workspace (for example, a downstream or target\nworkspace connected to the same branch\u002Ffolder).\n\n```bash\n# Read both hashes from the target workspace (git_status: see Commit to Git)\nSTATUS=$(git_status \"$TARGET_WS\") || exit 1\nTH=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$STATUS\")\nREMOTE=$(jq -r '.remoteCommitHash' \u003C\u003C\u003C\"$STATUS\")\n\ncat > update.json \u003C\u003CJSON\n{\n  \"workspaceHead\": \"${TH}\",\n  \"remoteCommitHash\": \"${REMOTE}\",\n  \"conflictResolution\": {\n    \"conflictResolutionType\": \"Workspace\",\n    \"conflictResolutionPolicy\": \"PreferRemote\"\n  },\n  \"options\": { \"allowOverrideItems\": true }\n}\nJSON\nfab api -X post \"workspaces\u002F${TARGET_WS}\u002Fgit\u002FupdateFromGit\" -i update.json\n```\n\n## Check Sync Status\n\nPoll until the workspace and remote heads match. Both `commitToGit` and\n`updateFromGit` are asynchronous, so this loop is how you know they finished.\n\n```bash\nfor i in $(seq 1 30); do\n  S=$(git_status \"$WORKSPACE_ID\") || exit 1\n  WH=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$S\")\n  RC=$(jq -r '.remoteCommitHash' \u003C\u003C\u003C\"$S\")\n  CH=$(jq -r '.changes | length' \u003C\u003C\u003C\"$S\")\n  # Success = heads match AND no residual changes. Heads matching alone can still\n  # leave uncommitted\u002Funapplied diffs; validate both before declaring \"synced\".\n  [ \"$WH\" = \"$RC\" ] && [ \"$CH\" = \"0\" ] && { echo \"synced at $WH\"; break; }\n  sleep 8\ndone\n```\n\nFor an operation still in flight, dispatch on the response code before polling.\n`commit_to_git` from [Commit to Git](#commit-to-git) already does this: `200`\nreturns at once, `202` polls the `x-ms-operation-id` it returned, and anything\nelse fails without polling. For `updateFromGit`, use the same pattern:\n\n```bash\nR=$(fab_json -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FupdateFromGit\" -i update.json) || exit 1\ncase \"$(jq -r '.status_code' \u003C\u003C\u003C\"$R\")\" in\n  200) ;;\n  202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$R\")\" || exit 1 ;;\n  *)   echo \"updateFromGit: HTTP $(jq -r '.status_code' \u003C\u003C\u003C\"$R\")\" >&2; jq '.text' \u003C\u003C\u003C\"$R\" >&2; exit 1 ;;\nesac\n```\n\n`git\u002Fstatus` also returns a `changes` array — a non-empty array means there are\nuncommitted (workspace) or unapplied (remote) differences.\n\n## Resolve Conflicts\n\nA genuine conflict is *changed-on-both-sides*: after the last sync, the **same\nitem** was modified in the workspace (an uncommitted local edit) **and** on the\nbranch (a new commit). `git\u002Fstatus` flags that item in its `changes` array with\n`conflictType: \"Conflict\"` (both `workspaceChange` and `remoteChange` show\n`Modified`). This is distinct from a one-sided diff, where only `updateFromGit`\n(remote-only change) or `commitToGit` (workspace-only change) is needed with no\npolicy.\n\nWhen both sides changed an item, `updateFromGit` **requires** a conflict policy —\ncalling it without a `conflictResolution` block returns\n`400 MissingWorkspaceConflictResolution`:\n\n- `conflictResolutionPolicy: \"PreferRemote\"` — the Git branch wins (typical for\n  pull-into-target deployment); the local edit is discarded.\n- `conflictResolutionPolicy: \"PreferWorkspace\"` — the live workspace wins; to\n  push the workspace version to Git instead use `commitToGit`, which does not\n  take a conflict policy.\n\nSet `options.allowOverrideItems: true` to let the update overwrite items that\nalready exist in the target workspace (required whenever the conflicting item is\nalready present in the workspace, which it is by definition in a both-sides\nconflict).\n\n**Which policy to pick:**\n\n| Scenario | Policy |\n|---|---|\n| Downstream\u002Ftarget workspace pulls the latest from Git | `PreferRemote` |\n| The authoring workspace is the source of truth | `PreferWorkspace` (or `commitToGit` to push the workspace version to Git) |\n| Genuine two-sided edits on the same item | Inspect each `changes` entry's `conflictType` in `git\u002Fstatus` and resolve deliberately per item |\n\n## Disconnect from Git\n\n```bash\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fdisconnect\"\n```\n\n---\n\n## Link a Branch Workspace to its Base (Workspace Relations)\n\n> **Preview.** The **Git workspace relations** APIs are part of the Fabric Git\n> surface and are in preview. They record a lineage link between a **branch**\n> workspace and the **base** workspace it was branched from, so the base↔branch\n> relationship is visible in the Fabric portal. Use them when a branch workspace\n> was created **before** the built-in branch-out feature shipped, or when branch\n> workspaces are provisioned by your own **automation** (not the portal branch-out\n> UX) and you still want that lineage to show in the UI. Creating a relation does\n> **not** connect either workspace to Git, move items, or start a sync — it only\n> records the link.\n\n**Precondition — both workspaces must point at the same Git root.** Create fails\nwith `WorkspaceRelationRootDirectoryMismatch` unless the base and branch workspaces\nare connected to the **same repository root**, differing only by branch:\n\n- **Azure DevOps:** same `organizationName`, `projectName`, `repositoryName`, and\n  `directoryName` — only `branchName` differs.\n- **GitHub:** same repository URL and `directoryName` — only `branchName` differs.\n\nSo connect (and initialize) both workspaces to Git first; the relation just makes\nthe existing branch\u002Fbase pair visible.\n\n### Create a relation (link branch ↔ base)\n\nThe relation is **bidirectional**, so you create it **once**. Read the body\ncarefully — the workspace you POST to and the `relationType` are two different\nthings:\n\n- The **URL** workspace (`workspaces\u002F{workspaceId}\u002F...`) is the side you call *from*.\n- `relatedWorkspaceId` is the **other** workspace.\n- `relationType` describes the role of that **other** (`relatedWorkspaceId`)\n  workspace, **not** the workspace in the URL. Only `Base` and `Branch` are valid\n  when creating.\n\nSo the same single link has two equivalent ways to create it:\n\n| Call from (URL workspace) | `relatedWorkspaceId` | `relationType` |\n|---|---|---|\n| the **branch** workspace | the **base** | `Base` |\n| the **base** workspace | the **branch** | `Branch` |\n\nDo **not** run both — once one direction exists, creating the other fails with\n`WorkspaceRelationBidirectionalExists`. Whichever side you call from, the\npermission requirement is the same: **Admin on the branch workspace and Contributor\n(or higher) on the base workspace.** The recommended (and most intuitive) form is\nto call from the branch and point at the base:\n\n```bash\n# From the BRANCH workspace, declare that the related workspace is its Base.\nprintf '{\"relatedWorkspaceId\":\"%s\",\"relationType\":\"Base\"}' \"${BASE_WS}\" > relation.json\nfab api -X post \"workspaces\u002F${BRANCH_WS}\u002Fgit\u002FworkspaceRelations\" -i relation.json\n```\n\nReturns `201`. Service principals and managed identities are supported.\n\n### List relations\n\nAny **Viewer or higher** can list a workspace's relations (paginate via\n`continuationToken`). `relationType` in responses can be `Base`, `Branch`, or\n`RelatedWorkspace`.\n\n```bash\nfab api \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FworkspaceRelations\"\n```\n\n### Delete a relation\n\nRemoves the lineage link only — it does **not** delete either workspace or its\nitems. The caller must be **Admin** on the workspace named in the path (either the\nbase or the branch side). Only a `Branch` relation is deletable — otherwise the API\nreturns `WorkspaceRelationTypeNotBranch`.\n\n```bash\nfab api -X delete \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FworkspaceRelations\u002F${RELATION_ID}\"\n```\n\n(Learn: rest\u002Fapi\u002Ffabric\u002Fcore\u002Fworkspace-relations.)\n\n---\n\n## Related: cross-workspace item binding\n\nUpdating a target workspace from the same branch promotes items into it. Whether\neach item-to-item reference rebinds automatically (logical IDs) or breaks (object\nIDs \u002F hardcoded endpoints) is a property of the item definition format, not of the\nGit lifecycle, and applies equally to fabric-cicd and the Bulk Import API. To\npredict a specific dependency's verdict, read the evidence-tagged compatibility\nmatrix, or empirically validate an uncertain reference, use the\n**cross-workspace-item-binding** skill (a planned companion skill, not yet\navailable in this repo) — it is a distinct concern from the\nconnect\u002Fcommit\u002Fupdate lifecycle this skill drives.\n\n## Related: Terraform (infrastructure as code)\n\nTo manage the **connect** side declaratively (infrastructure as code) instead of\nwith imperative `fab api` calls, use the **git-integration-terraform** skill (a\nplanned companion skill, not yet available in this repo). It\ncovers the `microsoft\u002Ffabric` provider's `fabric_connection` and\n`fabric_workspace_git` resources (Azure DevOps service principal or automatic,\nGitHub PAT, init strategy, plan\u002Fapply\u002Fimport). In that pattern Terraform owns the\nconnection, while the commit \u002F update-from-git \u002F status operations in this skill\nremain the imperative runtime path — so a common setup is Terraform for the\nconnection plus a CLI step for update-from-git.\n\n## Related: Variable Library (environment parameterization)\n\nGit integration moves item *definitions* across workspaces, but it does not by\nitself parameterize values that must differ per stage (dev\u002Ftest\u002Fprod) — connection\nstrings, endpoints, capacity IDs, feature flags. That per-environment\nparameterization is the job of a **Variable Library**: define the variables once,\nprovide a value set per stage, and have items resolve the stage-appropriate value.\nWhen a Git-synced workspace needs values that vary by environment, use the\n`variable-library-cli` companion skill for the variable\u002Fvalue-set\nmodeling instead of hardcoding or duplicating that logic here — this skill owns\nthe source-control lifecycle, the Variable Library skill owns the\nparameterization it feeds.\n\n## Gotchas, Rules, Troubleshooting\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `400 WorkspaceHeadMismatch` | Stale `workspaceHead` | Re-read `git\u002Fstatus`, retry with the current head |\n| `400 MissingWorkspaceConflictResolution` | Both sides changed the same item, but `updateFromGit` was sent without a `conflictResolution` | Add `conflictResolution` (policy `PreferRemote` or `PreferWorkspace`) + `options.allowOverrideItems: true`; check `git\u002Fstatus` for `conflictType: \"Conflict\"` first |\n| `WorkspaceHasNoCapacityAssigned` | Workspace not on a capacity (Git needs one) | Assign a capacity to the workspace, then retry |\n| `404 GitProviderResourceNotFound` on `git\u002Fconnect` | The repo, branch, or `directoryName` does not exist on the provider — the API, unlike the portal, does **not** auto-create the folder | Verify the repo\u002Fbranch names; if the **folder** is new, pre-create it by committing a `README.md` placeholder to the branch via the Git provider API (see [Connect a Workspace to Git](#connect-a-workspace-to-git)), then retry |\n| `WorkspaceAlreadyConnectedToGit` | Workspace is already linked to a repo | Disconnect first, then connect to the new repo |\n| `InsufficientPrivileges` \u002F `403` | Caller lacks the role the operation needs (connect\u002Fdisconnect need **Admin**; commit\u002Fupdate need at least **Contributor** with write on all items) | Grant the caller the required role: Admin to connect\u002Fdisconnect, or Contributor with write on all items to commit\u002Fupdate |\n| `PrincipalTypeNotSupported` | Service principal using automatic credentials (or GitHub) | Switch to a `ConfiguredConnection` in `myGitCredentials` |\n| `commitToGitRequest is required` (with `fab api`) | Body piped via stdin | Write the body to a file, pass `-i body.json` |\n| Operation returns `202` then nothing changes | Async not yet complete | Poll `operations\u002F{id}` (from `--show_headers`) with `wait_for_lro`; then check heads with `git_status`, which resolves a `202` from `operations\u002F{id}\u002Fresult` |\n| Operation stuck in `Running` for a long time | Large workspace or a second Git op is queued | Keep polling with a sane timeout (about 10 min); never start a second Git op concurrently |\n| `401 Unauthorized` | Wrong token audience | Run `fab auth login` (fab sets the audience automatically); on the `az rest` fallback pass `--resource https:\u002F\u002Fapi.fabric.microsoft.com` |\n| `WorkspaceRelationRootDirectoryMismatch` on `git\u002FworkspaceRelations` | Base and branch workspaces are connected to different Git roots | Connect both to the SAME repo\u002Forg\u002Fproject\u002Fdirectory (Azure DevOps) or repo URL\u002Fdirectory (GitHub), differing only by `branchName`, then retry |\n| `WorkspaceRelationAlreadyExists` \u002F `WorkspaceRelationBidirectionalExists` | The base↔branch relation is already recorded (it is bidirectional) | Nothing to do — `GET git\u002FworkspaceRelations` to confirm; do not also create the reverse direction |\n| `WorkspaceRelationTypeNotBranch` on delete | Tried to delete a relation that is not a `Branch` relation | Only `Branch` relations are deletable — use the correct `workspaceRelationId` and delete from the branch side |\n| Every sync reports an uncommitted change you did not make (one removed blank line, or a CRLF\u002FLF flip) | In affected workspaces, an editor or AI agent authored the item source (`notebook-content.py`, `pipeline-content.json`, `.platform`) with a trailing final newline or CRLF, then Fabric re-serialized it to the observed export form (LF, **no** trailing newline) | Confirm the behavior with a representative round trip, then match the observed export at authoring time: no trailing newline, LF endings. Pin it in the synced repo with `.editorconfig` + `.gitattributes`, and tell your AI agent not to add a final newline. See [git-integration-concepts.md § Avoiding formatting-only diffs](references\u002Fgit-integration-concepts.md#avoiding-formatting-only-diffs) |\n\n## Examples\n\n### Example 1: Commit source, then deploy into a target workspace\n\n```bash\n# Uses the helpers from \"Commit to Git\".\nSRC_STATUS=$(git_status \"$SRC_WS\") || exit 1\nbuild_commit_body \"$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$SRC_STATUS\")\" \"Deploy v1\" > commit.json \\\n  || { rm -f commit.json; exit 2; }\ncommit_to_git \"$SRC_WS\" commit.json || exit $?\n# ...check sync status of ${SRC_WS}, then updateFromGit into ${TARGET_WS} (see above)\n```\n\n### Example 2: `az rest` fallback equivalents\n\nWhen `fab` is unavailable, the same REST endpoints work through `az rest`. Always\npass `--resource`; a body can be inline (`--body '{...}'`) or from a file\n(`--body @file.json`):\n\n```bash\n# status\naz rest --method GET \\\n  --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002Fworkspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fstatus\" \\\n  --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"\n\n# commit (body from build_commit_body in \"Commit to Git\"). az rest prints only\n# the body and exits non-zero on 4xx\u002F5xx; it does not expose x-ms-operation-id,\n# so confirm completion with the \"Check Sync Status\" loop.\nbuild_commit_body \"$HEAD\" \"Author items\" > commit.json || { rm -f commit.json; exit 2; }\naz rest --method POST \\\n  --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002Fworkspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FcommitToGit\" \\\n  --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\" \\\n  --headers \"Content-Type=application\u002Fjson\" \\\n  --body @commit.json\n```\n","> **Telemetry — MANDATORY.** Every `api.fabric.microsoft.com` call must carry\n> `x-ms-fabric-skill: git-integration-operations-cli` (`az rest`: `--headers \"x-ms-fabric-skill=git-integration-operations-cli\"`),\n> including every LRO poll, `fabric_lro` and retry. Snippets omit it — add it anyway.\n\n> **CRITICAL NOTES**\n> 1. To find a workspace ID from its name: list all workspaces, then filter by\n>    `displayName` with JMESPath. To find an item ID: list items of that type in the\n>    workspace, then filter by `displayName`.\n> 2. All Git operations are **control plane** calls against\n>    `https:\u002F\u002Fapi.fabric.microsoft.com`. Run `fab auth login` once and `fab api`\n>    sets the base URL and Fabric token audience automatically. With the `az rest`\n>    fallback you must pass the matching `--resource` yourself, or you get a 401.\n> 3. `commitToGit`, `updateFromGit`, and even `git\u002Fstatus` can return **HTTP 202\n>    (long-running operation)**, not just a synchronous body. On `202`, poll the\n>    operation: with `fab`, read `x-ms-operation-id` from `--show_headers` and poll\n>    `fab api operations\u002F{id}` until `status` is `Succeeded`; with the `az rest`\n>    fallback, poll the `Location` \u002F `x-ms-operation-id` header (see COMMON-CORE\n>    long-running operation polling). When a `202` came from `git\u002Fstatus` itself,\n>    read its body from `operations\u002F{id}\u002Fresult` (the `git_status` helper does\n>    this); calling `git\u002Fstatus` again can just return another `202`. After a\n>    `commitToGit` \u002F `updateFromGit` operation succeeds, read status with\n>    `git_status` to confirm `workspaceHead == remoteCommitHash`, and do not act\n>    on its `changes` until the heads match. (Learn: rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit and\n>    fabric\u002Fcicd\u002Fgit-integration\u002Fgit-automation.)\n> 4. `updateFromGit` requires the workspace's **current** `workspaceHead`; a stale\n>    value returns `400 WorkspaceHeadMismatch`. Always read `git\u002Fstatus` first.\n> 5. **Prerequisites for every Git operation:** the workspace must be assigned to a\n>    **capacity** (an unassigned workspace fails with `WorkspaceHasNoCapacityAssigned`),\n>    and the caller (user or service principal) must hold the right workspace\n>    role: **connect and disconnect require Admin**; **commit and update require at\n>    least Contributor** with write permission on all items; **branch switching\n>    requires Admin** (or Contributor when the workspace opt-in setting *Allow users\n>    with at least Contributor role to change Git branch* is on). Only one Git\n>    operation may run against a workspace at a time.\n> 6. **Tenant admin switches** gate Git integration and are a common cause of an\n>    unexplained failure. The **GitHub** sync switch is **off by default** (enable it\n>    before any GitHub connect); Azure DevOps sync is on by default. Cross-region\n>    workspace-to-*Azure*-repo needs the **cross-geo export** switch (GitHub does not\n>    enforce it). See [references\u002Fgit-integration-concepts.md § Tenant admin prerequisites](references\u002Fgit-integration-concepts.md#tenant-admin-prerequisites).\n\n# Git Integration Operations — CLI Skill\n\nAutomate the Fabric Git integration lifecycle (connect, commit, update, status,\ndisconnect) from CLI environments. Whether cross-workspace item references rebind\nafter promotion is a separate concern, determined by the item definition format\n(logical vs object IDs) rather than the Git lifecycle itself.\n\n## Prerequisite Knowledge\n\nRead these shared references first (paths assume this skill lives under\n`skills\u002Fgit-integration-operations-cli\u002F` in `skills-for-fabric`; adjust when drafting\noutside the repo):\n\n- [COMMON-CLI.md § Finding Workspaces and Items in Fabric](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#finding-workspaces-and-items-in-fabric) — **Mandatory** for resolving workspace\u002Fitem IDs by name.\n- [COMMON-CORE.md § Authentication & Token Acquisition](..\u002F..\u002Fcommon\u002FCOMMON-CORE.md#authentication--token-acquisition) — wrong audience = 401; read before any auth issue.\n- [COMMON-CLI.md § Authentication Recipes](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#authentication-recipes) — `az login` flows and token acquisition for CLI.\n- [COMMON-CLI.md § Fabric Control-Plane API via az rest](..\u002F..\u002Fcommon\u002FCOMMON-CLI.md#fabric-control-plane-api-via-az-rest) — the `az rest` **fallback** path (**always pass `--resource`**); includes LRO polling helpers.\n- [COMMON-CORE.md § Core Control-Plane REST APIs](..\u002F..\u002Fcommon\u002FCOMMON-CORE.md#core-control-plane-rest-apis) — pagination, long-running-operation polling, rate limiting.\n\n## Table of Contents\n\n| Task | Reference |\n|---|---|\n| Pre-flight checks before connecting | [SKILL.md § Pre-Flight (before you connect)](#pre-flight-before-you-connect) |\n| Connect a workspace to Git | [SKILL.md § Connect a Workspace to Git](#connect-a-workspace-to-git) |\n| Create a git connection (service principal) | [SKILL.md § Create the Git provider connection (service principal)](#create-the-git-provider-connection-service-principal) |\n| Commit workspace items to Git | [SKILL.md § Commit to Git](#commit-to-git) |\n| Update a workspace from Git | [SKILL.md § Update from Git](#update-from-git) |\n| Check sync status | [SKILL.md § Check Sync Status](#check-sync-status) |\n| Resolve update conflicts | [SKILL.md § Resolve Conflicts](#resolve-conflicts) |\n| Disconnect from Git | [SKILL.md § Disconnect from Git](#disconnect-from-git) |\n| Link a branch workspace to its base (workspace relations) | [SKILL.md § Link a Branch Workspace to its Base (Workspace Relations)](#link-a-branch-workspace-to-its-base-workspace-relations) |\n| Git integration concepts (sync model, status, permissions) | [references\u002Fgit-integration-concepts.md § Concepts](references\u002Fgit-integration-concepts.md#concepts) |\n| Tenant admin prerequisites (switches) | [references\u002Fgit-integration-concepts.md § Tenant admin prerequisites](references\u002Fgit-integration-concepts.md#tenant-admin-prerequisites) |\n| Supported Git providers | [references\u002Fgit-integration-concepts.md § Supported Git providers](references\u002Fgit-integration-concepts.md#supported-git-providers) |\n| Supported item types | [references\u002Fgit-integration-concepts.md § Supported item types](references\u002Fgit-integration-concepts.md#supported-item-types) |\n| Avoiding formatting-only diffs (trailing newline \u002F line endings) | [references\u002Fgit-integration-concepts.md § Avoiding formatting-only diffs](references\u002Fgit-integration-concepts.md#avoiding-formatting-only-diffs) |\n| Service principal \u002F CI-CD pipeline templates | [references\u002Fautomation-templates.md](references\u002Fautomation-templates.md) |\n| Gotchas, Rules, Troubleshooting | [SKILL.md § Gotchas, Rules, Troubleshooting](#gotchas-rules-troubleshooting) |\n\n## Must\u002FPrefer\u002FAvoid\n\n### MUST DO\n- Read `git\u002Fstatus` and pass the current `workspaceHead` into every `commitToGit`\n  and `updateFromGit` call.\n- Generate a meaningful `commitToGit` comment of at most 300 characters. If the\n  requested text is longer, rewrite it concisely before the API call while\n  preserving intent; do not silently cut it mid-sentence. Retry once, with a\n  rewritten comment strictly shorter than the rejected one, only when Fabric\n  explicitly reports a comment-length validation error.\n- Poll `git\u002Fstatus` after each async operation until\n  `workspaceHead == remoteCommitHash` **and** the `changes` array is empty. A\n  `202`\u002F`Succeeded` status is not proof of a correct sync — validate the state.\n- Deploy an item together with the items it references in the same commit, so\n  logical IDs can resolve inside the target workspace.\n\n### MUST NEVER\n- Never run two Git operations concurrently on the same workspace — a second\n  `commitToGit`\u002F`updateFromGit` while one is still `Running` corrupts head\n  tracking. Serialize: poll the first to `Succeeded` before starting the next.\n- Never treat a workspace as both a source of truth **and** a CI\u002FCD push target\n  on the same branch. Pick one writer per branch: either humans commit from the\n  workspace, or automation pushes to Git — not both at once.\n\n### PREFER\n- `fab api` (after `fab auth login`) as the **primary** driver: it sets the base\n  URL and Fabric token audience automatically, avoiding the 401 wrong-audience\n  trap. Use `az rest` with `--resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"` as the\n  **fallback** when `fab` is unavailable or you need fine-grained header control.\n- `PreferRemote` conflict resolution for a clean \"pull latest from Git\" into a\n  downstream\u002Ftarget workspace.\n\n### AVOID\n- Reusing a stale `workspaceHead` (causes `400 WorkspaceHeadMismatch`).\n- Passing request bodies via stdin to `fab api` (use `-i \u003Cfile.json>` or `-i '\u003Cinline JSON>'`).\n\n---\n\n## CLI: `fab` primary, `az rest` fallback\n\nEvery operation below is shown with `fab api`. Run `fab auth login` once (it\nsupports service principals for automation); `fab` then handles the base URL and\ntoken audience for you. The identical call on the `az rest` fallback is a\nmechanical translation:\n\n**Authenticate `fab` for the identity you are running as:**\n\n```bash\nfab auth login                                              # interactive user (SSO)\nfab auth login -u \u003Cclient-id> -p \u003Cclient-secret> --tenant \u003Ctenant-id>   # service principal (CI\u002FCD)\nfab auth login --identity                                   # managed identity (Azure compute)\n```\n\nA service principal or managed identity must be workspace **Admin** to connect or\ndisconnect (at least **Contributor** with write on all items is enough for\ncommit\u002Fupdate) and (for the `ConfiguredConnection` path) hold the git provider\ncredentials. See\n[references\u002Fautomation-templates.md](references\u002Fautomation-templates.md) for full\npipeline scripts.\n\n- `fab api \u003Cendpoint>` becomes `az rest --method GET --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002F\u003Cendpoint>\" --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"`.\n- `fab api -X post \u003Cendpoint> -i body.json` adds `--method POST --headers \"Content-Type=application\u002Fjson\" --body @body.json`.\n\n`fab api` reads a request body via `-i` from either a file path or an inline JSON\nstring (e.g. `-i '{\"displayName\":\"...\"}'`) — never from stdin. It prints\n`{\"status_code\": \u003Ccode>, \"text\": \u003Cparsed body>}` (add `--show_headers` for a\ntop-level `headers` object), so read response fields with `jq -r '.text.\u003Cfield>'`\nand the LRO id with `jq -r '.headers[\"x-ms-operation-id\"]'`. See\n[Example 2](#example-2-az-rest-fallback-equivalents) for a full `az rest` pair.\n\n---\n\n## Pre-Flight (before you connect)\n\nRun these Git-relevant checks in order before `git\u002Fconnect`. Each failure has a\nspecific fix — resolving them up front avoids the most common connect-time errors.\n\n| Check | Command | Pass = proceed \u002F Fail = fix |\n|---|---|---|\n| Auth + Fabric token | `fab auth login` then `fab api workspaces` | `401` → re-login (`fab` sets the correct audience automatically) |\n| Caller is workspace Admin | `fab api \"workspaces\u002F${WORKSPACE_ID}\u002FroleAssignments\"` | Connect\u002Fdisconnect require the **Admin** role |\n| Workspace has capacity | `fab api \"workspaces\u002F${WORKSPACE_ID}\"` → check `capacityId` | `WorkspaceHasNoCapacityAssigned` → assign a capacity (Git requires one) |\n| Git credential for the SP path | `fab api connections` (reuse if one already fits) | SP connect needs a `ConfiguredConnection`. If none exists, the skill **creates** it from your ADO org\u002Fproject\u002Frepo + SP tenant\u002Fclient\u002Fsecret — see [Create the Git provider connection](#create-the-git-provider-connection-service-principal) (needs the tenant toggle \"service principals can create connections\"). The interactive-user SSO path uses `Automatic` and needs no connection. |\n| Target `directoryName` exists on the branch | GitHub: `curl -fsS -H \"Authorization: Bearer $PAT\" \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcontents\u002F$DIR?ref=$BRANCH\"` — ADO: Items API on the repo | The API (unlike the portal) does **not** create a missing folder — connecting to a `directoryName` that doesn't exist fails with `404 GitProviderResourceNotFound`. If the folder is new, pre-create it first (see the note under [Connect a Workspace to Git](#connect-a-workspace-to-git)). |\n\n## Connect a Workspace to Git\n\nConnect a workspace to an Azure DevOps or GitHub repo, then initialize the\nconnection to establish the sync direction.\n\n```bash\n# 1. Connect (Azure DevOps example). Body goes in a file, passed with -i.\ncat > connect.json \u003C\u003C'JSON'\n{\n  \"gitProviderDetails\": {\n    \"gitProviderType\": \"AzureDevOps\",\n    \"organizationName\": \"myorg\",\n    \"projectName\": \"MyProject\",\n    \"repositoryName\": \"fabric\",\n    \"branchName\": \"main\",\n    \"directoryName\": \"\u002Fworkspace-a\"\n  }\n}\nJSON\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fconnect\" -i connect.json\n\n# 2. Initialize the connection (choose which side wins on first sync)\nprintf '{\"initializationStrategy\":\"PreferWorkspace\"}' > init.json\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FinitializeConnection\" -i init.json\n```\n\nUse `PreferWorkspace` when the workspace already has the authoritative items;\n`PreferRemote` when the Git branch is authoritative.\n\n> **The target `directoryName` must already exist on the branch.** Unlike the Fabric\n> portal — which silently creates a missing folder by committing a `README.md`\n> placeholder into it — the `git\u002Fconnect` **API does not create the folder**.\n> Connecting to a `directoryName` that does not exist on the branch fails with\n> `404 GitProviderResourceNotFound`. The repo and branch must exist too (connect\n> never creates a branch). If the folder is new, create it first by committing a\n> placeholder file to the branch **through the Git provider's API** (not a Fabric\n> API), then connect. Match the portal's convention with a `README.md` whose body is\n> `This is an auto-created file via Fabric skills for \u003Cworkspace-name>`.\n>\n> ```bash\n> # GitHub: create \u003CDIR>\u002FREADME.md on \u003CBRANCH> (reuse the PAT behind the Git connection)\n> DIR=\"workspace-a\"; WS_NAME=\"My Workspace\"\n> CONTENT=$(printf 'This is an auto-created file via Fabric skills for %s\\n' \"$WS_NAME\" | base64)\n> cat > mkfolder.json \u003C\u003CJSON\n> { \"message\": \"Create ${DIR} folder for Fabric Git connect\", \"branch\": \"${BRANCH}\", \"content\": \"${CONTENT}\" }\n> JSON\n> curl -fsS -X PUT -H \"Authorization: Bearer ${GITHUB_PAT}\" \\\n>   \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F${OWNER}\u002F${REPO}\u002Fcontents\u002F${DIR}\u002FREADME.md\" -d @mkfolder.json\n> # Azure DevOps equivalent: POST ...\u002F_apis\u002Fgit\u002Frepositories\u002F${REPO}\u002Fpushes with an\n> # \"add\" change for \"\u002F${DIR}\u002FREADME.md\" on refs\u002Fheads\u002F${BRANCH} (same body content).\n> ```\n\n> **Two authentication modes (both providers use `myGitCredentials` for automation).**\n> A workspace authenticates to git in one of two ways:\n> - **Automatic git credential** (Azure DevOps only): the connecting user's SSO\n>   identity, established from workspace settings. Secondary contributors with at\n>   least Contributor reuse it. Not available for GitHub, and not usable for\n>   headless \u002F service-principal automation.\n> - **Configured credential** (Azure DevOps *and* GitHub): a Fabric cloud connection\n>   referenced in the connect body. This is the required path for any service\n>   principal or unattended run:\n>   ```json\n>   \"myGitCredentials\": { \"source\": \"ConfiguredConnection\", \"connectionId\": \"\u003Cconnection-guid>\" }\n>   ```\n>   For **Azure DevOps**, the connection's `credentialType` can be either\n>   `ServicePrincipal` (headless automation) or `OAuth2` (a stored delegated user\n>   token); both are valid ConfiguredConnection credentials per the Create Connection\n>   API and both support multitenant scenarios.\n>   For **GitHub**, connecting a workspace **requires a Personal Access Token (PAT)**:\n>   the cloud connection stores a fine-grained token with Contents Read (plus Write\n>   to commit), or a classic token with the `repo` scope. GitHub has no automatic\n>   credential mode, so a PAT is mandatory even for an interactive user connect.\n> The distinction is not \"GitHub needs credentials, ADO does not\". ADO *also*\n> requires a ConfiguredConnection whenever a service principal drives the connect;\n> the automatic mode only covers interactive user SSO. (Learn:\n> fabric\u002Fcicd\u002Fgit-integration\u002Fautomate-git-integration-with-service-principal;\n> rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit\u002Fconnect.)\n\n> **Handle the initialize response.** `initializeConnection` returns\n> `requiredAction` (`UpdateFromGit`, `CommitToGit`, or `None`) plus `workspaceHead`\n> and `remoteCommitHash`, and can itself return `202`. After it settles, call the\n> sync operation named by `requiredAction` with the returned hashes, or the\n> workspace stays connected but not fully synced. (Learn:\n> rest\u002Fapi\u002Ffabric\u002Fcore\u002Fgit\u002Finitialize-connection.)\n\n### Create the Git provider connection (service principal)\n\nFor unattended automation, first create a Fabric cloud connection that stores the\ngit provider credentials, then pass its `id` as the `connectionId` in the\n`myGitCredentials` block above. Use the\n[Create Connection API](https:\u002F\u002Flearn.microsoft.com\u002Frest\u002Fapi\u002Ffabric\u002Fcore\u002Fconnections\u002Fcreate-connection)\n(`POST \u002Fv1\u002Fconnections`, delegated scope `Connection.ReadWrite.All`). A service\nprincipal can create the connection only if the Fabric admin setting \"service\nprincipals can create workspaces, connections, and deployment pipelines\" is on.\n\n**Information you must supply (Azure DevOps):**\n- ADO **organization**, **project**, and **repository** names, combined into one\n  `url` parameter: `https:\u002F\u002Fdev.azure.com\u002F\u003Corg>\u002F\u003Cproject>\u002F_git\u002F\u003Crepo>\u002F`\n- The service principal's **tenant ID**, **client (application) ID**, and\n  **client secret**\n- A connection **display name** (max 200 chars, must be unique in the tenant)\n\n**Prerequisites before the connection will work:** grant the service principal\n(a) access to that **Azure DevOps organization and project** (git access is\nenforced by ADO itself, not only by Fabric), and (b) **Admin** on the target\nFabric workspace.\n\n```bash\n# Create an Azure DevOps source-control connection using a service principal.\n# The body holds a cleartext SP secret, so restrict perms and delete it on exit\n# (a leftover connection.json can be captured by a later CI step or artifact upload).\ntrap 'rm -f connection.json' EXIT\numask 077\ncat > connection.json \u003C\u003C'JSON'\n{\n  \"displayName\": \"ado-sp-fabric-cicd\",\n  \"connectivityType\": \"ShareableCloud\",\n  \"connectionDetails\": {\n    \"type\": \"AzureDevOpsSourceControl\",\n    \"creationMethod\": \"AzureDevOpsSourceControl.Contents\",\n    \"parameters\": [\n      { \"dataType\": \"Text\", \"name\": \"url\",\n        \"value\": \"https:\u002F\u002Fdev.azure.com\u002F\u003Corg>\u002F\u003Cproject>\u002F_git\u002F\u003Crepo>\u002F\" }\n    ]\n  },\n  \"credentialDetails\": {\n    \"credentials\": {\n      \"credentialType\": \"ServicePrincipal\",\n      \"tenantId\": \"\u003Ctenant-id>\",\n      \"servicePrincipalClientId\": \"\u003Cclient-id>\",\n      \"servicePrincipalSecret\": \"\u003Cclient-secret>\"\n    }\n  }\n}\nJSON\nfab api -X post \"connections\" -i connection.json\n```\n\nThe `201` response returns the connection `id`; use it as `connectionId` in the\n`myGitCredentials` block of the connect call. For a fully secret-free variant,\npass the body inline with `-i '{...}'` (no file on disk) or reference a Key Vault\nsecret via `servicePrincipalSecretReference` instead of the raw\n`servicePrincipalSecret`. The example above uses\n`credentialType: \"ServicePrincipal\"`; Azure DevOps connections also accept\n`credentialType: \"OAuth2\"` (a stored delegated user token), and both credential\ntypes support multitenant scenarios. To switch an *existing* user-connected\nworkspace to a service principal, add the SP as workspace Admin, share or recreate\nthis connection, then\n`PATCH \u002Fworkspaces\u002F{id}\u002Fgit\u002FmyGitCredentials` with the same ConfiguredConnection\nbody. (Learn:\nfabric\u002Fcicd\u002Fgit-integration\u002Fautomate-git-integration-with-service-principal;\nrest\u002Fapi\u002Ffabric\u002Fcore\u002Fconnections\u002Fcreate-connection.)\n\n## Commit to Git\n\nPush workspace items to the connected branch. Read the head first, then commit.\nThe optional `comment` becomes the Git commit message and has a 300-character\nmaximum. Generate or semantically condense it to fit before the first request.\nIf there is no useful comment, omit the field and let the Git provider supply\nits default.\n\nThese helpers are the canonical pattern for every snippet in this skill and in\n[references\u002Fautomation-templates.md](references\u002Fautomation-templates.md):\n\n```bash\n# Read one response header case-insensitively from a `fab api --show_headers` result.\nhdr() { jq -r --arg h \"$1\" '[(.headers \u002F\u002F {}) | to_entries[]\n  | select(.key | ascii_downcase == $h) | .value][0] \u002F\u002F empty'; }\n\n# Run `fab api` and require a parseable {status_code,text} envelope.\nfab_json() {\n  local r\n  r=$(fab api \"$@\" -H \"x-ms-fabric-skill=git-integration-operations-cli\" --show_headers 2>\u002Fdev\u002Fnull) || true\n  jq -e 'has(\"status_code\")' >\u002Fdev\u002Fnull 2>&1 \u003C\u003C\u003C\"$r\" \\\n    || { echo \"fab api $*: no parseable response\" >&2; return 1; }\n  printf '%s\\n' \"$r\"\n}\n\n# Poll an LRO (~10 min bound). Check the HTTP status before the body, honour\n# Retry-After on 429\u002F503, and fail on any other non-200. With \"result\", print the\n# completed operation's body from operations\u002F{id}\u002Fresult.\nwait_for_lro() {\n  local op=\"$1\" want=\"${2:-}\" r sc st=\"\" delay i\n  [ -n \"$op\" ] && [ \"$op\" != \"null\" ] \\\n    || { echo \"wait_for_lro: missing x-ms-operation-id\" >&2; return 1; }\n  for i in $(seq 1 120); do\n    r=$(fab_json \"operations\u002F${op}\") || return 1\n    sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n    delay=$(hdr retry-after \u003C\u003C\u003C\"$r\"); [[ \"$delay\" =~ ^[0-9]+$ ]] || delay=5\n    case \"$sc\" in\n      200) ;;\n      429|503) sleep \"$delay\"; continue ;;\n      *) echo \"LRO ${op}: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n    esac\n    st=$(jq -r '.text.status' \u003C\u003C\u003C\"$r\")\n    case \"$st\" in\n      Succeeded)\n        [ \"$want\" = \"result\" ] || return 0\n        r=$(fab_json \"operations\u002F${op}\u002Fresult\") || return 1\n        [ \"$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\" = \"200\" ] \\\n          || { echo \"LRO ${op}: result HTTP $(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\" >&2; return 1; }\n        jq -c '.text' \u003C\u003C\u003C\"$r\"; return 0 ;;\n      Failed|Undefined) echo \"LRO ${op}: ${st}\" >&2; jq '.text.error' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n    esac\n    sleep \"$delay\"\n  done\n  echo \"LRO ${op}: timed out (last status: ${st:-unknown})\" >&2; return 1\n}\n\n# Print the git\u002Fstatus body. A 202 is resolved from the LRO result, never by\n# calling git\u002Fstatus again (which can return another 202).\ngit_status() {\n  local r sc\n  r=$(fab_json \"workspaces\u002F$1\u002Fgit\u002Fstatus\") || return 1\n  sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n  case \"$sc\" in\n    200) jq -c '.text' \u003C\u003C\u003C\"$r\" ;;\n    202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$r\")\" result ;;\n    *)   echo \"git\u002Fstatus: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1 ;;\n  esac\n}\n\n# Write a commit body to stdout. Fails on a missing head or a comment over 300\n# UTF-16 code units (the service count; jq `length` undercounts emoji).\nbuild_commit_body() {\n  jq -en --arg head \"$1\" --arg msg \"$2\" '\n    def u16: [explode[] | if . > 65535 then 2 else 1 end] | add \u002F\u002F 0;\n    if ($head | length) == 0 or $head == \"null\" then\n      error(\"workspaceHead must be non-empty and non-null.\")\n    elif ($msg | u16) > 300 then\n      error(\"Commit comment must be 300 characters or fewer.\")\n    else\n      {mode:\"All\", workspaceHead:$head}\n      + if ($msg | length) > 0 then {comment:$msg} else {} end\n    end'\n}\n\n# Returns 0 committed, 3 service rejected the comment length, 1 any other failure.\ncommit_to_git() {\n  local r sc\n  r=$(fab_json -X post \"workspaces\u002F$1\u002Fgit\u002FcommitToGit\" -i \"$2\") || return 1\n  sc=$(jq -r '.status_code' \u003C\u003C\u003C\"$r\")\n  case \"$sc\" in\n    200) return 0 ;;\n    202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$r\")\"; return ;;\n    400)\n      if jq -e '.text | tostring | ascii_downcase\n          | test(\"comment\") and test(\"300|length\")' >\u002Fdev\u002Fnull \u003C\u003C\u003C\"$r\"; then\n        echo \"commitToGit: comment too long\" >&2; return 3\n      fi ;;\n  esac\n  echo \"commitToGit: HTTP ${sc}\" >&2; jq '.text' \u003C\u003C\u003C\"$r\" >&2; return 1\n}\n```\n\nCommit all pending changes:\n\n```bash\nSTATUS=$(git_status \"$WORKSPACE_ID\") || exit 1\nHEAD=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$STATUS\")\nCOMMIT_MSG=\"Author items\"\nbuild_commit_body \"$HEAD\" \"$COMMIT_MSG\" > commit.json || { rm -f commit.json; exit 2; }\nrc=0; commit_to_git \"$WORKSPACE_ID\" commit.json || rc=$?\nexit \"$rc\"\n```\n\nExit `2` means the request was never sent: fix the head or condense the comment.\nExit `3` means Fabric rejected the comment length: rewrite it strictly shorter\nthan the rejected comment (resending the same text gets the same `400`) and run\nthe commit once more. Treat any other non-zero exit as a failure and do not retry it\nas a length problem. Use `\"mode\": \"Selective\"` with an `items` array to commit a\nsubset.\n\n## Update from Git\n\nPull committed items into a workspace (for example, a downstream or target\nworkspace connected to the same branch\u002Ffolder).\n\n```bash\n# Read both hashes from the target workspace (git_status: see Commit to Git)\nSTATUS=$(git_status \"$TARGET_WS\") || exit 1\nTH=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$STATUS\")\nREMOTE=$(jq -r '.remoteCommitHash' \u003C\u003C\u003C\"$STATUS\")\n\ncat > update.json \u003C\u003CJSON\n{\n  \"workspaceHead\": \"${TH}\",\n  \"remoteCommitHash\": \"${REMOTE}\",\n  \"conflictResolution\": {\n    \"conflictResolutionType\": \"Workspace\",\n    \"conflictResolutionPolicy\": \"PreferRemote\"\n  },\n  \"options\": { \"allowOverrideItems\": true }\n}\nJSON\nfab api -X post \"workspaces\u002F${TARGET_WS}\u002Fgit\u002FupdateFromGit\" -i update.json\n```\n\n## Check Sync Status\n\nPoll until the workspace and remote heads match. Both `commitToGit` and\n`updateFromGit` are asynchronous, so this loop is how you know they finished.\n\n```bash\nfor i in $(seq 1 30); do\n  S=$(git_status \"$WORKSPACE_ID\") || exit 1\n  WH=$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$S\")\n  RC=$(jq -r '.remoteCommitHash' \u003C\u003C\u003C\"$S\")\n  CH=$(jq -r '.changes | length' \u003C\u003C\u003C\"$S\")\n  # Success = heads match AND no residual changes. Heads matching alone can still\n  # leave uncommitted\u002Funapplied diffs; validate both before declaring \"synced\".\n  [ \"$WH\" = \"$RC\" ] && [ \"$CH\" = \"0\" ] && { echo \"synced at $WH\"; break; }\n  sleep 8\ndone\n```\n\nFor an operation still in flight, dispatch on the response code before polling.\n`commit_to_git` from [Commit to Git](#commit-to-git) already does this: `200`\nreturns at once, `202` polls the `x-ms-operation-id` it returned, and anything\nelse fails without polling. For `updateFromGit`, use the same pattern:\n\n```bash\nR=$(fab_json -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FupdateFromGit\" -i update.json) || exit 1\ncase \"$(jq -r '.status_code' \u003C\u003C\u003C\"$R\")\" in\n  200) ;;\n  202) wait_for_lro \"$(hdr x-ms-operation-id \u003C\u003C\u003C\"$R\")\" || exit 1 ;;\n  *)   echo \"updateFromGit: HTTP $(jq -r '.status_code' \u003C\u003C\u003C\"$R\")\" >&2; jq '.text' \u003C\u003C\u003C\"$R\" >&2; exit 1 ;;\nesac\n```\n\n`git\u002Fstatus` also returns a `changes` array — a non-empty array means there are\nuncommitted (workspace) or unapplied (remote) differences.\n\n## Resolve Conflicts\n\nA genuine conflict is *changed-on-both-sides*: after the last sync, the **same\nitem** was modified in the workspace (an uncommitted local edit) **and** on the\nbranch (a new commit). `git\u002Fstatus` flags that item in its `changes` array with\n`conflictType: \"Conflict\"` (both `workspaceChange` and `remoteChange` show\n`Modified`). This is distinct from a one-sided diff, where only `updateFromGit`\n(remote-only change) or `commitToGit` (workspace-only change) is needed with no\npolicy.\n\nWhen both sides changed an item, `updateFromGit` **requires** a conflict policy —\ncalling it without a `conflictResolution` block returns\n`400 MissingWorkspaceConflictResolution`:\n\n- `conflictResolutionPolicy: \"PreferRemote\"` — the Git branch wins (typical for\n  pull-into-target deployment); the local edit is discarded.\n- `conflictResolutionPolicy: \"PreferWorkspace\"` — the live workspace wins; to\n  push the workspace version to Git instead use `commitToGit`, which does not\n  take a conflict policy.\n\nSet `options.allowOverrideItems: true` to let the update overwrite items that\nalready exist in the target workspace (required whenever the conflicting item is\nalready present in the workspace, which it is by definition in a both-sides\nconflict).\n\n**Which policy to pick:**\n\n| Scenario | Policy |\n|---|---|\n| Downstream\u002Ftarget workspace pulls the latest from Git | `PreferRemote` |\n| The authoring workspace is the source of truth | `PreferWorkspace` (or `commitToGit` to push the workspace version to Git) |\n| Genuine two-sided edits on the same item | Inspect each `changes` entry's `conflictType` in `git\u002Fstatus` and resolve deliberately per item |\n\n## Disconnect from Git\n\n```bash\nfab api -X post \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fdisconnect\"\n```\n\n---\n\n## Link a Branch Workspace to its Base (Workspace Relations)\n\n> **Preview.** The **Git workspace relations** APIs are part of the Fabric Git\n> surface and are in preview. They record a lineage link between a **branch**\n> workspace and the **base** workspace it was branched from, so the base↔branch\n> relationship is visible in the Fabric portal. Use them when a branch workspace\n> was created **before** the built-in branch-out feature shipped, or when branch\n> workspaces are provisioned by your own **automation** (not the portal branch-out\n> UX) and you still want that lineage to show in the UI. Creating a relation does\n> **not** connect either workspace to Git, move items, or start a sync — it only\n> records the link.\n\n**Precondition — both workspaces must point at the same Git root.** Create fails\nwith `WorkspaceRelationRootDirectoryMismatch` unless the base and branch workspaces\nare connected to the **same repository root**, differing only by branch:\n\n- **Azure DevOps:** same `organizationName`, `projectName`, `repositoryName`, and\n  `directoryName` — only `branchName` differs.\n- **GitHub:** same repository URL and `directoryName` — only `branchName` differs.\n\nSo connect (and initialize) both workspaces to Git first; the relation just makes\nthe existing branch\u002Fbase pair visible.\n\n### Create a relation (link branch ↔ base)\n\nThe relation is **bidirectional**, so you create it **once**. Read the body\ncarefully — the workspace you POST to and the `relationType` are two different\nthings:\n\n- The **URL** workspace (`workspaces\u002F{workspaceId}\u002F...`) is the side you call *from*.\n- `relatedWorkspaceId` is the **other** workspace.\n- `relationType` describes the role of that **other** (`relatedWorkspaceId`)\n  workspace, **not** the workspace in the URL. Only `Base` and `Branch` are valid\n  when creating.\n\nSo the same single link has two equivalent ways to create it:\n\n| Call from (URL workspace) | `relatedWorkspaceId` | `relationType` |\n|---|---|---|\n| the **branch** workspace | the **base** | `Base` |\n| the **base** workspace | the **branch** | `Branch` |\n\nDo **not** run both — once one direction exists, creating the other fails with\n`WorkspaceRelationBidirectionalExists`. Whichever side you call from, the\npermission requirement is the same: **Admin on the branch workspace and Contributor\n(or higher) on the base workspace.** The recommended (and most intuitive) form is\nto call from the branch and point at the base:\n\n```bash\n# From the BRANCH workspace, declare that the related workspace is its Base.\nprintf '{\"relatedWorkspaceId\":\"%s\",\"relationType\":\"Base\"}' \"${BASE_WS}\" > relation.json\nfab api -X post \"workspaces\u002F${BRANCH_WS}\u002Fgit\u002FworkspaceRelations\" -i relation.json\n```\n\nReturns `201`. Service principals and managed identities are supported.\n\n### List relations\n\nAny **Viewer or higher** can list a workspace's relations (paginate via\n`continuationToken`). `relationType` in responses can be `Base`, `Branch`, or\n`RelatedWorkspace`.\n\n```bash\nfab api \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FworkspaceRelations\"\n```\n\n### Delete a relation\n\nRemoves the lineage link only — it does **not** delete either workspace or its\nitems. The caller must be **Admin** on the workspace named in the path (either the\nbase or the branch side). Only a `Branch` relation is deletable — otherwise the API\nreturns `WorkspaceRelationTypeNotBranch`.\n\n```bash\nfab api -X delete \"workspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FworkspaceRelations\u002F${RELATION_ID}\"\n```\n\n(Learn: rest\u002Fapi\u002Ffabric\u002Fcore\u002Fworkspace-relations.)\n\n---\n\n## Related: cross-workspace item binding\n\nUpdating a target workspace from the same branch promotes items into it. Whether\neach item-to-item reference rebinds automatically (logical IDs) or breaks (object\nIDs \u002F hardcoded endpoints) is a property of the item definition format, not of the\nGit lifecycle, and applies equally to fabric-cicd and the Bulk Import API. To\npredict a specific dependency's verdict, read the evidence-tagged compatibility\nmatrix, or empirically validate an uncertain reference, use the\n**cross-workspace-item-binding** skill (a planned companion skill, not yet\navailable in this repo) — it is a distinct concern from the\nconnect\u002Fcommit\u002Fupdate lifecycle this skill drives.\n\n## Related: Terraform (infrastructure as code)\n\nTo manage the **connect** side declaratively (infrastructure as code) instead of\nwith imperative `fab api` calls, use the **git-integration-terraform** skill (a\nplanned companion skill, not yet available in this repo). It\ncovers the `microsoft\u002Ffabric` provider's `fabric_connection` and\n`fabric_workspace_git` resources (Azure DevOps service principal or automatic,\nGitHub PAT, init strategy, plan\u002Fapply\u002Fimport). In that pattern Terraform owns the\nconnection, while the commit \u002F update-from-git \u002F status operations in this skill\nremain the imperative runtime path — so a common setup is Terraform for the\nconnection plus a CLI step for update-from-git.\n\n## Related: Variable Library (environment parameterization)\n\nGit integration moves item *definitions* across workspaces, but it does not by\nitself parameterize values that must differ per stage (dev\u002Ftest\u002Fprod) — connection\nstrings, endpoints, capacity IDs, feature flags. That per-environment\nparameterization is the job of a **Variable Library**: define the variables once,\nprovide a value set per stage, and have items resolve the stage-appropriate value.\nWhen a Git-synced workspace needs values that vary by environment, use the\n`variable-library-cli` companion skill for the variable\u002Fvalue-set\nmodeling instead of hardcoding or duplicating that logic here — this skill owns\nthe source-control lifecycle, the Variable Library skill owns the\nparameterization it feeds.\n\n## Gotchas, Rules, Troubleshooting\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `400 WorkspaceHeadMismatch` | Stale `workspaceHead` | Re-read `git\u002Fstatus`, retry with the current head |\n| `400 MissingWorkspaceConflictResolution` | Both sides changed the same item, but `updateFromGit` was sent without a `conflictResolution` | Add `conflictResolution` (policy `PreferRemote` or `PreferWorkspace`) + `options.allowOverrideItems: true`; check `git\u002Fstatus` for `conflictType: \"Conflict\"` first |\n| `WorkspaceHasNoCapacityAssigned` | Workspace not on a capacity (Git needs one) | Assign a capacity to the workspace, then retry |\n| `404 GitProviderResourceNotFound` on `git\u002Fconnect` | The repo, branch, or `directoryName` does not exist on the provider — the API, unlike the portal, does **not** auto-create the folder | Verify the repo\u002Fbranch names; if the **folder** is new, pre-create it by committing a `README.md` placeholder to the branch via the Git provider API (see [Connect a Workspace to Git](#connect-a-workspace-to-git)), then retry |\n| `WorkspaceAlreadyConnectedToGit` | Workspace is already linked to a repo | Disconnect first, then connect to the new repo |\n| `InsufficientPrivileges` \u002F `403` | Caller lacks the role the operation needs (connect\u002Fdisconnect need **Admin**; commit\u002Fupdate need at least **Contributor** with write on all items) | Grant the caller the required role: Admin to connect\u002Fdisconnect, or Contributor with write on all items to commit\u002Fupdate |\n| `PrincipalTypeNotSupported` | Service principal using automatic credentials (or GitHub) | Switch to a `ConfiguredConnection` in `myGitCredentials` |\n| `commitToGitRequest is required` (with `fab api`) | Body piped via stdin | Write the body to a file, pass `-i body.json` |\n| Operation returns `202` then nothing changes | Async not yet complete | Poll `operations\u002F{id}` (from `--show_headers`) with `wait_for_lro`; then check heads with `git_status`, which resolves a `202` from `operations\u002F{id}\u002Fresult` |\n| Operation stuck in `Running` for a long time | Large workspace or a second Git op is queued | Keep polling with a sane timeout (about 10 min); never start a second Git op concurrently |\n| `401 Unauthorized` | Wrong token audience | Run `fab auth login` (fab sets the audience automatically); on the `az rest` fallback pass `--resource https:\u002F\u002Fapi.fabric.microsoft.com` |\n| `WorkspaceRelationRootDirectoryMismatch` on `git\u002FworkspaceRelations` | Base and branch workspaces are connected to different Git roots | Connect both to the SAME repo\u002Forg\u002Fproject\u002Fdirectory (Azure DevOps) or repo URL\u002Fdirectory (GitHub), differing only by `branchName`, then retry |\n| `WorkspaceRelationAlreadyExists` \u002F `WorkspaceRelationBidirectionalExists` | The base↔branch relation is already recorded (it is bidirectional) | Nothing to do — `GET git\u002FworkspaceRelations` to confirm; do not also create the reverse direction |\n| `WorkspaceRelationTypeNotBranch` on delete | Tried to delete a relation that is not a `Branch` relation | Only `Branch` relations are deletable — use the correct `workspaceRelationId` and delete from the branch side |\n| Every sync reports an uncommitted change you did not make (one removed blank line, or a CRLF\u002FLF flip) | In affected workspaces, an editor or AI agent authored the item source (`notebook-content.py`, `pipeline-content.json`, `.platform`) with a trailing final newline or CRLF, then Fabric re-serialized it to the observed export form (LF, **no** trailing newline) | Confirm the behavior with a representative round trip, then match the observed export at authoring time: no trailing newline, LF endings. Pin it in the synced repo with `.editorconfig` + `.gitattributes`, and tell your AI agent not to add a final newline. See [git-integration-concepts.md § Avoiding formatting-only diffs](references\u002Fgit-integration-concepts.md#avoiding-formatting-only-diffs) |\n\n## Examples\n\n### Example 1: Commit source, then deploy into a target workspace\n\n```bash\n# Uses the helpers from \"Commit to Git\".\nSRC_STATUS=$(git_status \"$SRC_WS\") || exit 1\nbuild_commit_body \"$(jq -r '.workspaceHead' \u003C\u003C\u003C\"$SRC_STATUS\")\" \"Deploy v1\" > commit.json \\\n  || { rm -f commit.json; exit 2; }\ncommit_to_git \"$SRC_WS\" commit.json || exit $?\n# ...check sync status of ${SRC_WS}, then updateFromGit into ${TARGET_WS} (see above)\n```\n\n### Example 2: `az rest` fallback equivalents\n\nWhen `fab` is unavailable, the same REST endpoints work through `az rest`. Always\npass `--resource`; a body can be inline (`--body '{...}'`) or from a file\n(`--body @file.json`):\n\n```bash\n# status\naz rest --method GET \\\n  --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002Fworkspaces\u002F${WORKSPACE_ID}\u002Fgit\u002Fstatus\" \\\n  --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\"\n\n# commit (body from build_commit_body in \"Commit to Git\"). az rest prints only\n# the body and exits non-zero on 4xx\u002F5xx; it does not expose x-ms-operation-id,\n# so confirm completion with the \"Check Sync Status\" loop.\nbuild_commit_body \"$HEAD\" \"Author items\" > commit.json || { rm -f commit.json; exit 2; }\naz rest --method POST \\\n  --url \"https:\u002F\u002Fapi.fabric.microsoft.com\u002Fv1\u002Fworkspaces\u002F${WORKSPACE_ID}\u002Fgit\u002FcommitToGit\" \\\n  --resource \"https:\u002F\u002Fapi.fabric.microsoft.com\" \\\n  --headers \"Content-Type=application\u002Fjson\" \\\n  --body @commit.json\n```\n",{"name":5,"metadata":49,"description":7},{"owner":50,"maturity":51},"yaron","experimental","main","f8fac110ac3b93e9d1f7b0bd8feac5c6a468ce43","skills\u002Fgit-integration-operations-cli",395,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-12 20:10:24",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add microsoft\u002Fskills-for-fabric --skill git-integration-operations-cli",{"tool":67,"command":68},"bunx","bunx skills add microsoft\u002Fskills-for-fabric --skill git-integration-operations-cli",{"tool":70,"command":71},"pnpm","pnpm dlx skills add microsoft\u002Fskills-for-fabric --skill git-integration-operations-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fgit-integration-operations-cli\u002FSKILL.md",true,[75,81,85],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"apm.yml","REFERENCE","参考文档",481,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fgit-integration-operations-cli\u002Fapm.yml",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fautomation-templates.md",7029,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fgit-integration-operations-cli\u002Freferences\u002Fautomation-templates.md",{"path":86,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fgit-integration-concepts.md",10449,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fgit-integration-operations-cli\u002Freferences\u002Fgit-integration-concepts.md",[90,98,103,126,153,158],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":97},"01M78JNNY5VN2MZ7TSV040K3FJ","fabric-policies-cli","Author, review and manage Microsoft Fabric governance policies and PolicySet items. Invoke before clarifying underspecified lockdown requests or missing intent, identities or scope. Discover current contracts and roles, map scenarios to rules, and execute one approved API lifecycle. Not catalog audits or KQL policies. Triggers: Fabric policy, PolicySet, governance rule, latest Fabric policies, policy contract review.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Ffabric-policies-cli\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":99,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":97},"01M78JNBFP3GAR4MSKEMHY2HDE","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fplugins\u002Ffabric-skills\u002Fskills\u002Ffabric-policies-cli\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":44},"01M6PHZNVB6K7DCCJH4YZHKC4F","ontology-cli","Manages Microsoft Fabric Ontology items: authors legacy V1 entity\u002Frelationship definitions and answers questions for new-experience (V2) Ontologies through ask_ontology. Use for Ontology item operations or grounded questions; V2 authoring\u002Fupgrades and V1 queries are unsupported. Power BI data questions use fabriciq, report authoring powerbi-report-cli, and model\u002FDAX changes semantic-model-authoring.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fontology-cli\u002FSKILL.md",[],[25,110,111,112,9,27,113,114,115,116,117,118,119,120,121,122,123,33,124,125],"ontology","ontology cli","ask","bi","microsoft fabric","changes","queries","power bi","relationship","fabriciq","v1","Legacy","use","upgrades","model","power",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":135,"publishedAt":44},"01M6PHZ91CSTP67DM6JN8TYEFV","databasehub-cli","Analyzes Database Hub inventory, health, and security posture through Entra-authenticated Fabric APIs. Use for estate counts; SQL\u002FPostgreSQL CPU, storage, and memory; Cosmos DB availability\u002FRU; authentication\u002Fauditing\u002FCMK warnings; and Fabric SQL inventory. Fabric SQL tuning routes to sqldb-cli; Warehouse\u002FLakehouse\u002FMirrored Database SQL to sqldw-cli. Triggers: data estate performance, database estate health, database security posture.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fskills\u002Fdatabasehub-cli\u002FSKILL.md",[132],{"categoryNo":133,"categoryName":134,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",[25,136,137,138,139,140,141,142,143,33,122,144,145,146,147,148,149,150,151,152],"databasehub cli","database","CPU","database sql","security posture","postgresql","health","database security","triggers","cosmos","authentication","inventory","performance","db","memory","availability","warehouse",{"skillNo":154,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":44},"01M6PHYVDVBD0VQN4FFAMN428Z","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fplugins\u002Ffabric-skills\u002Fskills\u002Fontology-cli\u002FSKILL.md",[],[25,110,111,33,124,125,119,123,115,9,27,113,114,116,117,118,112,120,121,122],{"skillNo":159,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":163,"publishedAt":44},"01M6PHYDZ17VY69E3GS71KFW09","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-fabric\u002Fblob\u002Fmain\u002Fplugins\u002Ffabric-skills\u002Fskills\u002Fdatabasehub-cli\u002FSKILL.md",[162],{"categoryNo":133,"categoryName":134,"taxonomyType":21,"taxonomyTypeDesc":22},[25,136,152,151,139,149,148,147,138,140,141,142,143,137,122,144,145,150,33,146]]