powerbi-consumption-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUpdate Check — ONCE PER SESSION (mandatory) The first time this skill is used in a session, run the check-updates skill before proceeding.
- GitHub Copilot CLI / VS Code: invoke the
skill.check-updates- Claude Code / Cowork / Cursor / Windsurf / Codex: compare local vs remote package.json version.
- Skip if the check was already performed earlier in this session.
CRITICAL NOTES
- To find the workspace details (including its ID) from workspace name: list all workspaces and, then, use JMESPath filtering
- To find the item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace and, then, use JMESPath filtering
更新检查 — 每个会话仅需一次(必填) 在会话中首次使用此技能前,请先运行check-updates技能。
- GitHub Copilot CLI / VS Code:调用
技能。check-updates- Claude Code / Cowork / Cursor / Windsurf / Codex:比较本地与远程package.json版本。
- 若本次会话中已执行过检查,则可跳过。
重要说明
- 要从工作区名称获取工作区详情(包括其ID):列出所有工作区,然后使用JMESPath过滤
- 要从工作区ID、项类型和项名称获取项详情(包括其ID):列出该工作区中所有对应类型的项,然后使用JMESPath过滤
Power BI Semantic Model Consumption — CLI Skill
Power BI Semantic Model 消费 — CLI技能
Table of Contents
目录
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md § Finding Workspaces and Items in Fabric | Mandatory — READ link first [needed for finding workspace id by its name or item id by its name, item type, and workspace id] |
| Fabric Topology & Key Concepts | COMMON-CORE.md § Fabric Topology & Key Concepts | Hierarchy; Finding Things in Fabric |
| Environment URLs | COMMON-CORE.md § Environment URLs | Production (Public Cloud) |
| Authentication & Token Acquisition | COMMON-CORE.md § Authentication & Token Acquisition | Wrong audience = 401; covers token audiences, delegated vs app permissions, OAuth flows, identity types, and Entra app registration |
| Core Control-Plane REST APIs | COMMON-CORE.md § Core Control-Plane REST APIs | Includes workspace/item CRUD, resolve-by-name, pagination, LRO polling, and rate-limiting patterns |
| OneLake Data Access | COMMON-CORE.md § OneLake Data Access | Requires |
| Job Execution | COMMON-CORE.md § Job Execution | Run On-Demand Job; Get / Cancel Job |
| Capacity Management | COMMON-CORE.md § Capacity Management | List Capacities; Assign Workspace to Capacity |
| Gotchas, Best Practices & Troubleshooting | COMMON-CORE.md § Gotchas, Best Practices & Troubleshooting | Common Errors; Best Practices |
| Tool Selection Rationale | COMMON-CLI.md § Tool Selection Rationale | |
| Authentication Recipes | COMMON-CLI.md § Authentication Recipes | |
Fabric Control-Plane API via | COMMON-CLI.md § Fabric Control-Plane API via | Always pass |
OneLake Data Access via | COMMON-CLI.md § OneLake Data Access via | Use |
| SQL / TDS Data-Plane Access | COMMON-CLI.md § SQL / TDS Data-Plane Access | |
| Job Execution (CLI) | COMMON-CLI.md § Job Execution | Run notebooks/pipelines, refresh semantic models, check/cancel jobs |
| OneLake Shortcuts | COMMON-CLI.md § OneLake Shortcuts | Create a Shortcut; List Shortcuts; Delete a Shortcut |
| Capacity Management (CLI) | COMMON-CLI.md § Capacity Management | List Capacities; Assign Workspace to Capacity |
| Composite Recipes | COMMON-CLI.md § Composite Recipes | End-to-end workspace→lakehouse→file, SQL endpoint→query, and notebook execution recipes |
| Gotchas & Troubleshooting (CLI-Specific) | COMMON-CLI.md § Gotchas & Troubleshooting (CLI-Specific) | |
| Quick Reference | COMMON-CLI.md § Quick Reference | |
| Prerequisites | SKILL.md § Prerequisites | |
| Must/Prefer/Avoid | SKILL.md § Must/Prefer/Avoid | Guardrails for read-only semantic model usage. MUST DO; PREFER; AVOID |
| Metadata Discovery | SKILL.md § Metadata Discovery | INFO.VIEW.* and INFO.* functions. |
| Recommended Discovery Order | SKILL.md § Recommended Discovery Order | Preferred order for metadata exploration |
| Frequently Used INFO Functions | SKILL.md § Frequently Used INFO Functions | High-usage function list for first-pass discovery |
| Complete INFO Function Catalog (Dynamic) | discovery-queries.md § Complete INFO Function Catalog (Dynamic) | |
| Metadata Object → INFO Function Map | SKILL.md § Metadata Object → INFO Function Map | Inlined mapping for object-focused discovery |
| Query Execution | SKILL.md § Query Execution | ExecuteQuery usage shape |
| Troubleshooting | SKILL.md § Troubleshooting | Resolve common execution and metadata issues |
| Examples | SKILL.md § Examples | Sample Metadata Query; Sample Data Query |
| Scope Estimation Queries | discovery-queries.md § Scope Estimation Queries | |
| INFO Output Columns | discovery-queries.md § INFO Output Columns | INFO.VIEW.* (preferred first-pass metadata); Critical INFO.* (deep metadata / diagnostics) |
| Narrowing Results (Projection + Filtering) | discovery-queries.md § Narrowing Results (Projection + Filtering) | |
| Deep Metadata Queries | discovery-queries.md § Deep Metadata Queries | |
| Dependency Discovery | discovery-queries.md § Dependency Discovery | Dependency rowset for a DAX query; Dependency rows scoped to a measure; Reverse dependencies (what references a measure) |
| 任务 | 参考链接 | 说明 |
|---|---|---|
| 在Fabric中查找工作区和项 | COMMON-CLI.md § 在Fabric中查找工作区和项 | 必填 — 先阅读链接内容[需要通过名称查找工作区ID,或通过名称、项类型和工作区ID查找项ID] |
| Fabric拓扑与核心概念 | COMMON-CORE.md § Fabric拓扑与核心概念 | 层级结构;在Fabric中查找资源 |
| 环境URL | COMMON-CORE.md § 环境URL | 生产环境(公有云) |
| 身份验证与令牌获取 | COMMON-CORE.md § 身份验证与令牌获取 | 受众错误会导致401;涵盖令牌受众、委托权限与应用权限、OAuth流程、身份类型以及Entra应用注册 |
| 核心控制平面REST API | COMMON-CORE.md § 核心控制平面REST API | 包含工作区/项的CRUD操作、按名称解析、分页、LRO轮询以及速率限制模式 |
| OneLake数据访问 | COMMON-CORE.md § OneLake数据访问 | 需要 |
| 作业执行 | COMMON-CORE.md § 作业执行 | 运行按需作业;获取/取消作业 |
| 容量管理 | COMMON-CORE.md § 容量管理 | 列出容量;为工作区分配容量 |
| 常见问题、最佳实践与故障排除 | COMMON-CORE.md § 常见问题、最佳实践与故障排除 | 常见错误;最佳实践 |
| 工具选择依据 | COMMON-CLI.md § 工具选择依据 | |
| 身份验证方案 | COMMON-CLI.md § 身份验证方案 | |
通过 | COMMON-CLI.md § 通过 | 务必传递 |
通过 | COMMON-CLI.md § 通过 | 使用 |
| SQL / TDS数据平面访问 | COMMON-CLI.md § SQL / TDS数据平面访问 | |
| 作业执行(CLI) | COMMON-CLI.md § 作业执行 | 运行笔记本/管道、刷新语义模型、检查/取消作业 |
| OneLake快捷方式 | COMMON-CLI.md § OneLake快捷方式 | 创建快捷方式;列出快捷方式;删除快捷方式 |
| 容量管理(CLI) | COMMON-CLI.md § 容量管理 | 列出容量;为工作区分配容量 |
| 复合方案 | COMMON-CLI.md § 复合方案 | 端到端的工作区→湖仓→文件、SQL端点→查询以及笔记本执行方案 |
| 常见问题与故障排除(CLI专属) | COMMON-CLI.md § 常见问题与故障排除(CLI专属) | |
| 快速参考 | COMMON-CLI.md § 快速参考 | |
| 先决条件 | SKILL.md § 先决条件 | |
| 必须/推荐/避免 | SKILL.md § 必须/推荐/避免 | 只读语义模型使用的约束规则。必须执行;推荐执行;避免执行 |
| 元数据发现 | SKILL.md § 元数据发现 | INFO.VIEW.* 和 INFO.* 函数。 |
| 推荐的发现顺序 | SKILL.md § 推荐的发现顺序 | 元数据探索的首选顺序 |
| 常用INFO函数 | SKILL.md § 常用INFO函数 | 首次发现时常用的函数列表 |
| 完整INFO函数目录(动态) | discovery-queries.md § 完整INFO函数目录(动态) | |
| 元数据对象 → INFO函数映射 | SKILL.md § 元数据对象 → INFO函数映射 | 面向对象发现的内联映射 |
| 查询执行 | SKILL.md § 查询执行 | ExecuteQuery的使用方式 |
| 故障排除 | SKILL.md § 故障排除 | 解决常见的执行和元数据问题 |
| 示例 | SKILL.md § 示例 | 元数据查询示例;数据查询示例 |
| 范围估算查询 | discovery-queries.md § 范围估算查询 | |
| INFO输出列 | discovery-queries.md § INFO输出列 | INFO.VIEW.(首选的首次元数据查询);关键INFO.(深度元数据/诊断) |
| 缩小结果范围(投影+过滤) | discovery-queries.md § 缩小结果范围(投影+过滤) | |
| 深度元数据查询 | discovery-queries.md § 深度元数据查询 | |
| 依赖关系发现 | discovery-queries.md § 依赖关系发现 | DAX查询的依赖关系行集;度量值的依赖关系行;反向依赖(哪些对象引用了该度量值) |
Prerequisites
先决条件
- COMMON-CORE.md — Fabric concepts, authentication, and control-plane API context.
- COMMON-CLI.md — CLI-oriented discovery and token/audience patterns.
- COMMON-CORE.md — Fabric概念、身份验证以及控制平面API上下文。
- COMMON-CLI.md — 面向CLI的资源发现以及令牌/受众模式。
Must/Prefer/Avoid
必须/推荐/避免
MUST DO
必须执行
- Keep this skill read-only: metadata discovery and analytical DAX queries only.
- Treat DAX data queries and as available to any user with read access to the semantic model; assume other
INFO.VIEW.*functions may require elevated permissions.INFO.* - Resolve workspace and semantic model item identity dynamically; do not hardcode IDs.
- Use DAX /
INFO.VIEW.*for metadata discovery before writing data queries.INFO.*
- 保持此技能为只读模式:仅用于元数据发现和分析性DAX查询。
- 假设拥有语义模型只读权限的用户均可使用DAX数据查询和函数;其他
INFO.VIEW.*函数可能需要更高权限。INFO.* - 动态解析工作区和语义模型项的标识;不要硬编码ID。
- 在编写数据查询前,使用DAX /
INFO.VIEW.*进行元数据发现。INFO.*
PREFER
推荐执行
- Validate semantic model scope early () before iterative query refinement.
artifactId - Discover semantic model schema progressively: use filtered and projected /
INFO.VIEW.*calls (e.g.,INFO.*+SELECTCOLUMNS) to fetch only the information directly relevant to the current task instead of retrieving the full schema up front. See discovery-queries.md § Narrowing Results (Projection + Filtering).FILTER - Keep guidance provider-agnostic so tool endpoint migration is low risk.
- 在迭代查询优化前,尽早验证语义模型范围()。
artifactId - 逐步发现语义模型架构:使用带过滤和投影的/
INFO.VIEW.*调用(例如INFO.*+SELECTCOLUMNS),仅获取与当前任务直接相关的信息,而非提前检索完整架构。请参阅discovery-queries.md § 缩小结果范围(投影+过滤)。FILTER - 保持指导内容与工具无关,降低工具端点迁移的风险。
AVOID
避免执行
- Model-change operations in this skill.
- 在本技能中执行模型修改操作。
Recommended Discovery Order
推荐的发现顺序
- Run the discovery-queries.md § Scope Estimation Queries to estimate metadata scope (table, column, measure, and relationship counts) before deep discovery.
- Start with for a fast table inventory.
INFO.VIEW.TABLES() - Expand to and
INFO.VIEW.COLUMNS()for semantic details.INFO.VIEW.MEASURES() - Use to validate joins and filter behavior.
INFO.VIEW.RELATIONSHIPS() - Use the full query catalog in discovery-queries.md for deeper patterns.
- 运行discovery-queries.md § 范围估算查询,在深度发现前估算元数据范围(表、列、度量值和关系的数量)。
- 从开始,快速获取表清单。
INFO.VIEW.TABLES() - 扩展到和
INFO.VIEW.COLUMNS()获取语义细节。INFO.VIEW.MEASURES() - 使用验证连接和过滤行为。
INFO.VIEW.RELATIONSHIPS() - 使用discovery-queries.md中的完整查询目录进行更深入的模式探索。
Frequently Used INFO Functions
常用INFO函数
INFO.VIEW.TABLESINFO.VIEW.MEASURESINFO.VIEW.COLUMNSINFO.VIEW.RELATIONSHIPSINFO.PARTITIONSINFO.MODELINFO.STORAGETABLECOLUMNSEGMENTSINFO.DEPENDENCIESINFO.EXPRESSIONSINFO.ROLESINFO.STORAGETABLECOLUMNSINFO.CALCULATIONGROUPSINFO.CALCULATIONITEMSINFO.CULTURESINFO.OBJECTTRANSLATIONSINFO.USERDEFINEDFUNCTIONSINFO.REFRESHPOLICIESINFO.ATTRIBUTEHIERARCHYSTORAGESINFO.COLUMNPARTITIONSTORAGESINFO.COLUMNSTORAGESINFO.DICTIONARYSTORAGESINFO.HIERARCHYSTORAGESINFO.PARTITIONSTORAGESINFO.RELATIONSHIPINDEXSTORAGESINFO.RELATIONSHIPSTORAGESINFO.SEGMENTMAPSTORAGESINFO.SEGMENTSTORAGESINFO.STORAGEFOLDERSINFO.STORAGEFILESINFO.TABLESTORAGESINFO.GENERALSEGMENTMAPSEGMENTMETADATASTORAGESINFO.DELTATABLEMETADATASTORAGESINFO.PARQUETFILESTORAGESINFO.STORAGETABLES
INFO.VIEW.TABLESINFO.VIEW.MEASURESINFO.VIEW.COLUMNSINFO.VIEW.RELATIONSHIPSINFO.PARTITIONSINFO.MODELINFO.STORAGETABLECOLUMNSEGMENTSINFO.DEPENDENCIESINFO.EXPRESSIONSINFO.ROLESINFO.STORAGETABLECOLUMNSINFO.CALCULATIONGROUPSINFO.CALCULATIONITEMSINFO.CULTURESINFO.OBJECTTRANSLATIONSINFO.USERDEFINEDFUNCTIONSINFO.REFRESHPOLICIESINFO.ATTRIBUTEHIERARCHYSTORAGESINFO.COLUMNPARTITIONSTORAGESINFO.COLUMNSTORAGESINFO.DICTIONARYSTORAGESINFO.HIERARCHYSTORAGESINFO.PARTITIONSTORAGESINFO.RELATIONSHIPINDEXSTORAGESINFO.RELATIONSHIPSTORAGESINFO.SEGMENTMAPSTORAGESINFO.SEGMENTSTORAGESINFO.STORAGEFOLDERSINFO.STORAGEFILESINFO.TABLESTORAGESINFO.GENERALSEGMENTMAPSEGMENTMETADATASTORAGESINFO.DELTATABLEMETADATASTORAGESINFO.PARQUETFILESTORAGESINFO.STORAGETABLES
Metadata Object → INFO Function Map
元数据对象 → INFO函数映射
| Metadata Object | Primary INFO functions |
|---|---|
| Model | |
| Tables | |
| Columns | |
| Measures | |
| Relationships | |
| Partitions | |
| Security roles & permissions | |
| Hierarchies | |
| Calculation groups/items | |
| Perspectives | |
| Calendars | |
| Cultures | |
| Object translations | |
| Functions | |
| Dependencies / lineage | |
| Storage internals / size | |
| 元数据对象 | 主要INFO函数 |
|---|---|
| Model | |
| Tables | |
| Columns | |
| Measures | |
| Relationships | |
| Partitions | |
| 安全角色与权限 | |
| Hierarchies | |
| Calculation groups/items | |
| Perspectives | |
| Calendars | |
| Cultures | |
| Object translations | |
| Functions | |
| 依赖关系/血缘 | |
| 存储内部/大小 | |
Query Execution
查询执行
Use a single capability with payload concepts:
ExecuteQuery- : target semantic model identifier.
artifactId - : direct DAX query text.
daxQuery
Temporary implementation note: current query integration is expected to be replaced before release by a public HTTP endpoint exposing.ExecuteQuery
使用单一的功能,包含以下负载概念:
ExecuteQuery- : 目标语义模型标识符。
artifactId - : 直接的DAX查询文本。
daxQuery
临时实现说明:当前的查询集成预计在发布前会被公开HTTP端点替代,该端点将暴露功能。ExecuteQuery
Troubleshooting
故障排除
- ExecuteQuery capability is unavailable in the MCP server
- Issue: Query execution cannot start because is not available in the active tool list.
ExecuteQuery - Cause: The Fabric MCP server is not registered, not loaded, or the current client session has stale tool metadata.
- Fix: Verify the active MCP server/tool inventory and confirm is exposed.
ExecuteQuery
- Issue: Query execution cannot start because
- Advanced INFO functions return permission errors
- Issue: Queries against fail with authorization or privilege-related errors.
INFO.* - Cause: Many functions require elevated semantic model permissions beyond standard read access.
INFO.* - Fix: Start with functions for read-oriented discovery.
INFO.VIEW.*
- Issue: Queries against
- Metadata output volume is too large for focused analysis
- Issue: Returning full metadata rowsets introduces too many properties and crowds the working context.
- Cause: Unbounded and
INFO.VIEW.*queries return broad object/property surfaces that are often unnecessary for the current task.INFO.* - Fix: Use the scope estimation queries in discovery-queries.md § Scope Estimation Queries to estimate scope and inspect output schemas, then narrow results with projection and filtering as shown in discovery-queries.md § Narrowing Results (Projection + Filtering).
- Do not use DAX functions to retrieve role memberships
INFO- Issue: returns empty or incomplete results.
INFO.ROLEMEMBERSHIPS() - Cause: Role members are assigned at the service level (Entra ID) after deployment, not in the model definition — so DAX functions cannot reliably surface them.
INFO - Fix: Use the Power BI REST API instead. See powerbi-authoring-cli § Security Role Memberships.
- Issue:
- ExecuteQuery功能在MCP服务器中不可用
- 问题: 由于不在活动工具列表中,查询无法启动。
ExecuteQuery - 原因: Fabric MCP服务器未注册、未加载,或当前客户端会话的工具元数据已过期。
- 解决方法: 验证活动MCP服务器/工具清单,确认已暴露。
ExecuteQuery
- 问题: 由于
- 高级INFO函数返回权限错误
- 问题: 针对的查询因授权或权限相关错误失败。
INFO.* - 原因: 许多函数需要超出标准只读权限的更高语义模型权限。
INFO.* - 解决方法: 从函数开始进行面向只读的发现。
INFO.VIEW.*
- 问题: 针对
- 元数据输出量过大,不利于聚焦分析
- 问题: 返回完整的元数据行集会引入过多属性,占用工作上下文。
- 原因: 无限制的和
INFO.VIEW.*查询会返回广泛的对象/属性信息,而这些信息通常与当前任务无关。INFO.* - 解决方法: 使用discovery-queries.md § 范围估算查询中的范围估算查询来估算范围并检查输出架构,然后通过投影和过滤缩小结果范围,具体请参阅discovery-queries.md § 缩小结果范围(投影+过滤)。
- 不要使用DAX函数检索角色成员
INFO- 问题: 返回空或不完整的结果。
INFO.ROLEMEMBERSHIPS() - 原因: 角色成员是在部署后在服务级别(Entra ID)分配的,而非在模型定义中,因此DAX 函数无法可靠地获取这些信息。
INFO - 解决方法: 改用Power BI REST API。请参阅powerbi-authoring-cli § 安全角色成员。
- 问题:
Examples
示例
For the full query catalog (including dependency patterns), see discovery-queries.md.
如需完整的查询目录(包括依赖关系模式),请参阅discovery-queries.md。
Sample Metadata Query
元数据查询示例
dax
EVALUATE
INFO.VIEW.TABLES()
ORDER BY [Name]dax
EVALUATE
INFO.VIEW.TABLES()
ORDER BY [Name]Sample Data Query
数据查询示例
dax
DEFINE
MEASURE 'Sales'[Total Sales] = SUM('Sales'[Amount])
EVALUATE
SUMMARIZECOLUMNS(
'Customer'[Customer Name],
"Total Sales", [Total Sales]
)
ORDER BY [Total Sales] DESCdax
DEFINE
MEASURE 'Sales'[Total Sales] = SUM('Sales'[Amount])
EVALUATE
SUMMARIZECOLUMNS(
'Customer'[Customer Name],
"Total Sales", [Total Sales]
)
ORDER BY [Total Sales] DESC