search-consumption-cli
作者: microsoft
更新檢查 — 每個工作階段一次(強制) 此技能在一個工作階段中首次使用時,請先執行 check-updates 技能再繼續。
npx skills add https://github.com/microsoft/skills-for-fabric --skill search-consumption-cliUpdate 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
check-updatesskill (e.g.,/fabric-skills:check-updates).- Claude Code / Cowork / Cursor / Windsurf / Codex: read the local
package.jsonversion, then compare it against the remote version viagit fetch origin main --quiet && git show origin/main:package.json(or the GitHub API). If the remote version is newer, show the changelog and update instructions.- Skip if the check was already performed earlier in this session.
CRITICAL NOTES
- The Catalog Search API finds items, not workspaces. To find a workspace by name, use
GET /v1/workspaces(see COMMON-CLI.md § Resolve Workspace Properties by Name).- The search text matches against item display name, description, and workspace name.
- Dataflow (Gen1) and Dataflow (Gen2) are not supported.
Catalog Search — CLI Skill
Prerequisite Knowledge
- COMMON-CORE.md — Fabric REST API patterns, auth
- COMMON-CLI.md — CLI implementation (az, curl, jq)
Table of Contents
| Task | Reference | Notes |
|---|---|---|
| Search for an Item | SKILL.md § Search for an Item | By name, description, or workspace name |
| List All Items of a Type | SKILL.md § List All Items of a Type | Empty search + type filter |
| Pagination | SKILL.md § Pagination | Continuation token pattern |
| Agentic Workflow | SKILL.md § Agentic Workflow | |
| Examples | SKILL.md § Examples | |
| Gotchas and Troubleshooting | SKILL.md § Gotchas and Troubleshooting |
Must/Prefer/Avoid
MUST DO
- Authenticate first — see COMMON-CORE.md § Authentication & Token Acquisition and COMMON-CLI.md § Authentication Recipes. The Catalog Search API requires
Catalog.Read.Allscope. - Write the JSON body to a temp file — avoids shell quoting issues with filter strings.
- Disambiguate — if multiple results match, present display name, type, and workspace name and ask the user to confirm.
PREFER
- Catalog Search over list-and-filter — single cross-workspace call, no need to resolve workspace first.
- Type filters — narrow results with
"filter": "Type eq 'Lakehouse'"to reduce noise. - Empty search with type filter — to list all items of a type across workspaces.
jqfor extracting IDs from the response — cleaner than JMESPath for nestedhierarchy.workspace.
AVOID
- Searching for workspaces — the Catalog Search API returns items, not workspaces. Use
GET /v1/workspacesinstead (see COMMON-CLI.md § Resolve Workspace Properties by Name). - Inventing filter syntax — only
eq,ne,or, and parentheses are supported. - Assuming all item types are supported — Dataflow (Gen1) and Dataflow (Gen2) are not returned yet.
Search for an Item
cat > /tmp/body.json << 'EOF'
{"search": "SalesLakehouse", "filter": "Type eq 'Lakehouse'", "pageSize": 10}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json
The search text matches against item display name, description and workspace name. Type filtering is optional. The response includes id, type, displayName, description, and hierarchy.workspace (with id and displayName) for each match.
Extract item and workspace IDs
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json \
--query "value[0].{itemId:id, workspaceId:hierarchy.workspace.id, name:displayName}" \
--output json
Filter Examples
| Goal | Filter |
|---|---|
| Only lakehouses | Type eq 'Lakehouse' |
| Reports or semantic models | Type eq 'Report' or Type eq 'SemanticModel' |
| Exclude notebooks | Type ne 'Notebook' |
For the full list of supported item types, see the Catalog Search API reference.
List All Items of a Type
Use an empty search string with a type filter (pageSize max is 1000):
cat > /tmp/body.json << 'EOF'
{"search": "", "filter": "Type eq 'Lakehouse'", "pageSize": 100}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json
Pagination
If the response includes a non-null continuationToken, pass it in the next request:
cat > /tmp/body.json << 'EOF'
{"search": "", "filter": "Type eq 'Lakehouse'", "pageSize": 100, "continuationToken": "<token>"}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json
Continue until continuationToken is null.
Agentic Workflow
- Ask — user provides an item name, type, or description keywords.
- Search — call Catalog Search with the user's input and optional type filter.
- Disambiguate — if multiple matches, present results (name, type, workspace) and ask the user to pick.
- Return — provide the search results, include the item
idandhierarchy.workspace.idfor downstream use.
Examples
Find a specific report
cat > /tmp/body.json << 'EOF'
{"search": "Monthly Sales Revenue", "filter": "Type eq 'Report'", "pageSize": 10}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json \
--query "value[].{name:displayName, type:type, workspace:hierarchy.workspace.displayName}" \
--output table
List all semantic models across workspaces
cat > /tmp/body.json << 'EOF'
{"search": "", "filter": "Type eq 'SemanticModel'", "pageSize": 1000}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json
Save search results to file
cat > /tmp/body.json << 'EOF'
{"search": "", "filter": "Type eq 'Lakehouse'", "pageSize": 1000}
EOF
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/catalog/search" \
--body @/tmp/body.json \
--query "value[].{name:displayName, type:type, workspace:hierarchy.workspace.displayName, id:id}" \
--output json > /tmp/search_results.json
Gotchas and Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized | Wrong token audience or expired session | Verify --resource "https://api.fabric.microsoft.com". Run az login. |
InvalidPageSize | pageSize outside 1–1000 | Use a value between 1 and 1000. |
InvalidFilter | Bad filter syntax | Only eq, ne, or, and parentheses. Don't mix eq with and, or ne with or. Don't mix eq and ne in the same filter. |
TypeNotFound | Unrecognized item type in filter | Check spelling (case-sensitive). See API reference for valid types. |
FilterTooManyValues | Filter has more than 500 values | Reduce the number of type values in the filter. |
InvalidRequest | Missing request body | Ensure --body points to a valid JSON file. |
| Empty results for known item | Item type not supported | Dataflow Gen1/Gen2 are excluded. Use GET /v1/workspaces/{id}/items instead. |
| New item not found | Catalog index propagation delay | Newly created items can take up to 24 hours to appear in search results. Verify the item exists via GET /v1/workspaces/{id}/items instead. |
| Too many results | Search text too broad | Add a type filter or use more specific search text. |
來自 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