fabric-cli-core

作者: microsoft

使用 Microsoft Fabric CLI (fab) 管理工作區、語意模型、報表、筆記本及 Fabric 資源。當使用者提及 fab、Fabric CLI 或…時啟用。

npx skills add https://github.com/microsoft/fabric-cli --skill fabric-cli-core

Fabric CLI Core

This skill defines safe, consistent defaults for an AI agent helping users operate Microsoft Fabric via the Fabric CLI (fab).

1 - Fabric CLI mental model (paths and entities)

Automation Scripts

Ready-to-use Python scripts for core CLI tasks. Run any script with --help for full options.

ScriptPurposeUsage
health_check.pyVerify CLI installation, auth status, and connectivitypython scripts/health_check.py [--workspace WS]

Scripts are located in the scripts/ folder of this skill.

Paths and Entities

  • Treat Fabric as a filesystem-like hierarchy with consistent dot (.) entity suffixes in paths (e.g., .Workspace, .Folder, .SemanticModel).
  • The hierarchy structure is:
    • Tenant: The top-level container for everything.
    • Workspace: Personal or team workspace holding folders, items, and workspace-level elements.
    • Folder: Container for organizing items within a workspace (supports ~10 levels of nesting).
    • Item: Individual resource within a workspace or folder (e.g., Notebook, SemanticModel, Lakehouse).
    • OneLakeItem: OneLake storage item residing within a Lakehouse (tables, files, etc.).
  • Prefer and generate paths like:
    • /Workspace1.Workspace/Notebook1.Notebook
    • /Workspace1.Workspace/FolderA.Folder/SemanticModel1.SemanticModel
    • /Workspace1.Workspace/FolderA.Folder/lh1.Lakehouse/Tables (OneLakeItem)
  • When a user provides an ambiguous identifier, ask for the full path (or infer with stated assumptions).

2 - Modes (interactive vs command line)

  • Be explicit about which mode a user is in:
    • Interactive mode behaves like a REPL and runs commands without the fab prefix.
    • Command line mode runs one command per invocation and is best for scripts/automation.
  • The selected mode is preserved between sessions. If a user exits and logs back in, the CLI resumes in the same mode last used.
  • When you provide instructions, show commands in command line mode unless the user says they're in interactive mode.

3 - Authentication (public-safe guidance)

  • Prefer these auth patterns and do not invent new flows:
    1. Interactive user: fab auth login (browser/WAM where supported).
    2. Service principal (secret/cert): use environment variables / secure mechanisms; avoid embedding secrets in files.
    3. Service principal (federated credential): use the federated token environment variable (FAB_SPN_FEDERATED_TOKEN) and do not persist the raw token.
    4. Managed identity: supported for Azure-hosted workloads; no credentials required.
  • Never ask users to paste secrets into chat or print them back.

4 - Sensitive data handling (strict)

  • Never log or output tokens, passwords, client secrets, or raw federated tokens.
  • Validate all user inputs that could affect security:
    • Paths: Sanitize file paths and API parameters.
    • GUIDs: Validate resource identifiers before use.
    • JSON: Validate JSON inputs for proper format.
  • If a user shares sensitive strings, advise rotating/regenerating them and moving to secure storage.

5 - Hidden entities and discovery

  • Hidden entities are special resources not normally visible, following a dot-prefixed naming convention (similar to UNIX hidden files).
  • Tenant-level hidden entities (accessed from root):
    • .capacitiesfab ls .capacities / fab get .capacities/<name>.Capacity
    • .gatewaysfab ls .gateways / fab get .gateways/<name>.Gateway
    • .connectionsfab ls .connections / fab get .connections/<name>.Connection
    • .domainsfab ls .domains / fab get .domains/<name>.Domain
  • Workspace-level hidden entities (accessed within a workspace):
    • .managedidentitiesfab ls ws1.Workspace/.managedidentities
    • .managedprivateendpointsfab ls ws1.Workspace/.managedprivateendpoints
    • .externaldatasharesfab ls ws1.Workspace/.externaldatashares
    • .sparkpoolsfab ls ws1.Workspace/.sparkpools
  • To show hidden resources, recommend ls -a / ls --all.

6 - Errors and troubleshooting guidance

  • When describing failures, include:
    • What the command was trying to do
    • The likely cause
    • The next actionable step
  • If the CLI surfaces an error code/message, keep it intact and do not paraphrase away the key identifiers. (Fabric CLI emphasizes stable error codes/messages.)
  • Include request IDs for API errors to aid debugging when available.

7 - Output conventions for the agent

  • Default to concise, runnable steps.
  • When recommending commands, include:
    • Preconditions (auth, correct workspace/path)
    • Expected result
    • How to verify (e.g., follow-up fab ls / fab get)

8 - Safety defaults

  • Ask before suggesting commands that delete, overwrite, or change access/permissions.
  • If the user explicitly confirms, proceed with a clear rollback note when possible.

9 - Platform and troubleshooting reference

  • Supported platforms: Windows, Linux, macOS.
  • Supported shells: zsh, bash, PowerShell, cmd (Windows command prompt).
  • Python versions: 3.10, 3.11, 3.12, 3.13.
  • CLI file storage (useful for troubleshooting):
    • Config files are stored in ~/.config/fab/:
      • cache.bin — encrypted auth token cache
      • config.json — non-sensitive CLI settings
      • auth.json — non-sensitive auth info
      • context-<session_id> — path context for command-line mode sessions
    • Debug logs are written to:
      • Windows: %AppData%/fabcli_debug.log
      • macOS: ~/Library/Logs/fabcli_debug.log
      • Linux: ~/.local/state/fabcli_debug.log

10 - Critical operational rules

  • First run: Always run fab auth status to verify authentication before executing commands. If not authenticated, ask the user to run fab auth login.
  • Learn before executing: Always use fab --help and fab <command> --help the first time you use a command to understand its syntax.
  • Start simple: Try the basic fab command alone first before piping or chaining.
  • Non-interactive mode: Use fab in command-line mode when working with coding agents. Interactive mode doesn't work with automation.
  • Force flag: Use -f when executing commands if the flag is available to run non-interactively (skips confirmation prompts).
  • Verify before acting: If workspace or item name is unclear, ask the user first, then verify with fab ls or fab exists before proceeding.
  • Permission errors: If a command is blocked by permissions, stop and ask the user for clarification; never try to circumvent it.

11 - Common item types

ExtensionDescription
.WorkspaceWorkspace container
.FolderFolder within workspace
.SemanticModelPower BI dataset/semantic model
.ReportPower BI report
.DashboardPower BI dashboard
.NotebookFabric notebook
.LakehouseLakehouse
.WarehouseData warehouse
.DataPipelineData pipeline
.SparkJobDefinitionSpark job definition
.EventstreamReal-time event stream
.KQLDatabaseKQL database
.MLModelML model
.MLExperimentML experiment
.CapacityFabric capacity (hidden)
.GatewayData gateway (hidden)
.ConnectionConnection (hidden)

Use fab desc .<ItemType> to explore any item type.

12 - Command references

For detailed command syntax and working examples, see:

來自 microsoft 的更多技能

oss-growth
microsoft
開源增長駭客角色
official
microsoft-foundry
microsoft
端到端部署、評估與管理 Foundry 代理:Docker 建置、ACR 推送、託管/提示代理建立、容器啟動、批次評估、持續評估、提示最佳化工作流程、agent.yaml、從追蹤資料集整理。用途:將代理部署至 Foundry、託管代理、建立代理、調用代理、評估代理、執行批次評估、持續評估、持續監控、持續評估狀態、最佳化提示、改善提示、提示最佳化器、最佳化代理指令、改善代理...
officialdevelopmentdevops
azure-ai
microsoft
用於 Azure AI:搜尋、語音、OpenAI、文件智慧。協助搜尋、向量/混合搜尋、語音轉文字、文字轉語音、轉錄、OCR。適用情境:AI 搜尋、查詢搜尋、向量搜尋、混合搜尋、語意搜尋、語音轉文字、文字轉語音、轉錄、OCR、將文字轉換為語音。
officialdevelopmentapi
azure-deploy
microsoft
對已準備好的應用程式執行 Azure 部署,這些應用程式需具備現有的 .azure/deployment-plan.md 與基礎架構檔案。當使用者要求建立新應用程式時,請勿使用此技能——應改用 azure-prepare。此技能會執行 azd up、azd deploy、terraform apply 及 az deployment 命令,並內建錯誤復原機制。需具備來自 azure-prepare 的 .azure/deployment-plan.md,以及來自 azure-validate 的驗證狀態。適用時機:「執行 azd up」、「執行 azd deploy」、「執行部署」……
officialdevopsaws
azure-storage
microsoft
Azure Storage Services 包括 Blob 儲存體、檔案共用、佇列儲存體、表格儲存體和 Data Lake。回答關於儲存存取層(熱、冷、凍結、封存)、各層使用時機及層級比較的問題。提供物件儲存、SMB 檔案共用、非同步訊息、NoSQL 鍵值及大數據分析。包含生命週期管理。用於:blob 儲存體、檔案共用、佇列儲存體、表格儲存體、data lake、上傳檔案、下載 blob、儲存帳戶、存取層...
officialdevelopmentdatabase
azure-diagnostics
microsoft
在 Azure 上使用 AppLens、Azure Monitor、資源健康狀態和安全分類來偵錯 Azure 生產問題。適用時機:偵錯生產問題、疑難排解應用程式服務、應用程式服務高 CPU、應用程式服務部署失敗、疑難排解容器應用程式、疑難排解函數、疑難排解 AKS、kubectl 無法連線、kube-system/CoreDNS 失敗、Pod 擱置、CrashLoop、節點未就緒、升級失敗、分析記錄、KQL、深入解析、映像提取失敗、冷啟動問題、健康狀態探查失敗...
officialdevopsdevelopment
azure-prepare
microsoft
準備 Azure 應用程式以進行部署(基礎架構 Bicep/Terraform、azure.yaml、Dockerfile)。用於建立/現代化或建立+部署;不適用於跨雲端遷移(請使用 azure-cloud-migrate)。請勿用於:copilot-sdk 應用程式(請使用 azure-hosted-copilot-sdk)。適用時機:「建立應用程式」、「建置 Web 應用程式」、「建立 API」、「建立無伺服器 HTTP API」、「建立前端」、「建立後端」、「建置服務」、「現代化應用程式」、「更新應用程式」、「新增驗證」、「新增快取」、「託管於 Azure」、「建立並...」
officialdevelopmentdevops
azure-validate
microsoft
部署前驗證 Azure 就緒狀態。對設定、基礎架構(Bicep 或 Terraform)、RBAC 角色指派、受控身分權限及先決條件進行深度檢查,再進行部署。適用時機:驗證我的應用程式、檢查部署就緒狀態、執行預檢檢查、驗證設定、確認是否可部署、驗證 azure.yaml、驗證 Bicep、部署前測試、疑難排解部署錯誤、驗證 Azure Functions、驗證函式應用程式、驗證無伺服器...
officialdevopstesting