fabric-cli-core
作者: microsoft
使用 Microsoft Fabric CLI (fab) 管理工作区、语义模型、报告、笔记本和 Fabric 资源。当用户提到 fab、Fabric CLI 或……时激活。
npx skills add https://github.com/microsoft/fabric-cli --skill fabric-cli-coreFabric 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.
| Script | Purpose | Usage |
|---|---|---|
health_check.py | Verify CLI installation, auth status, and connectivity | python 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
fabprefix. - Command line mode runs one command per invocation and is best for scripts/automation.
- Interactive mode behaves like a REPL and runs commands without the
- 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:
- Interactive user:
fab auth login(browser/WAM where supported). - Service principal (secret/cert): use environment variables / secure mechanisms; avoid embedding secrets in files.
- Service principal (federated credential): use the federated token environment variable (
FAB_SPN_FEDERATED_TOKEN) and do not persist the raw token. - Managed identity: supported for Azure-hosted workloads; no credentials required.
- Interactive user:
- 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):
.capacities—fab ls .capacities/fab get .capacities/<name>.Capacity.gateways—fab ls .gateways/fab get .gateways/<name>.Gateway.connections—fab ls .connections/fab get .connections/<name>.Connection.domains—fab ls .domains/fab get .domains/<name>.Domain
- Workspace-level hidden entities (accessed within a workspace):
.managedidentities—fab ls ws1.Workspace/.managedidentities.managedprivateendpoints—fab ls ws1.Workspace/.managedprivateendpoints.externaldatashares—fab ls ws1.Workspace/.externaldatashares.sparkpools—fab 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 cacheconfig.json— non-sensitive CLI settingsauth.json— non-sensitive auth infocontext-<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
- Windows:
- Config files are stored in
10 - Critical operational rules
- First run: Always run
fab auth statusto verify authentication before executing commands. If not authenticated, ask the user to runfab auth login. - Learn before executing: Always use
fab --helpandfab <command> --helpthe first time you use a command to understand its syntax. - Start simple: Try the basic
fabcommand alone first before piping or chaining. - Non-interactive mode: Use
fabin command-line mode when working with coding agents. Interactive mode doesn't work with automation. - Force flag: Use
-fwhen 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 lsorfab existsbefore 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
| Extension | Description |
|---|---|
.Workspace | Workspace container |
.Folder | Folder within workspace |
.SemanticModel | Power BI dataset/semantic model |
.Report | Power BI report |
.Dashboard | Power BI dashboard |
.Notebook | Fabric notebook |
.Lakehouse | Lakehouse |
.Warehouse | Data warehouse |
.DataPipeline | Data pipeline |
.SparkJobDefinition | Spark job definition |
.Eventstream | Real-time event stream |
.KQLDatabase | KQL database |
.MLModel | ML model |
.MLExperiment | ML experiment |
.Capacity | Fabric capacity (hidden) |
.Gateway | Data gateway (hidden) |
.Connection | Connection (hidden) |
Use fab desc .<ItemType> to explore any item type.
12 - Command references
For detailed command syntax and working examples, see:
- Quick Start Guide — Copy-paste examples for common tasks
- Full Command Reference — All commands with flags and patterns
- Semantic Models — TMDL, DAX queries, refresh, storage modes
- Notebooks — Job execution, parameters, scheduling
- Reports — Export, import, rebind to models
- Workspaces — Create, manage, permissions
- Querying Data — DAX and lakehouse table queries
- API Reference — Direct REST API access patterns
- Create Workspaces — Workspace creation workflows
来自 microsoft 的更多技能
oss-growth
microsoft
OSS增长黑客角色
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存储服务,包括Blob存储、文件共享、队列存储、表存储和Data Lake。解答关于存储访问层(热、冷、冷、归档)的问题,说明各层的使用场景及对比。提供对象存储、SMB文件共享、异步消息传递、NoSQL键值存储和大数据分析。包含生命周期管理。用途:Blob存储、文件共享、队列存储、表存储、Data Lake、上传文件、下载Blob、存储账户、访问层等。
officialdevelopmentdatabase
azure-diagnostics
microsoft
使用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