
search-consumption-cli
โ Officialโ 729by microsoft ยท part of microsoft/skills-for-fabric
Search the Microsoft Fabric catalog to find an item by name across all workspaces when you don't know which workspace it is in, using the Fabric Catalog Search API. Use when the user wants to: (1) search the catalog for an item by name across workspaces, (2) discover or list items of a specific type across the tenant, (3) identify which workspace contains an item, (4) return item/workspace IDs for downstream API calls. Triggers: "search for an item", "search the catalog", "catalog search", "sear
This is the playbook your agent receives when the skill activates โ you don't need to read it to use the skill, but it's here to audit before installing.
Telemetry โ MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: search-consumption-cli(az rest:--headers "x-ms-fabric-skill=search-consumption-cli"), including every LRO poll,fabric_lroand retry. Snippets omit it โ add it anyway.
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). - Querying source data after the workspace/item is known โ route to the workload-specific consumption skill (
sqldw-cli,spark-cli,eventhouse-cli, orfabriciq) instead of Catalog Search. - 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.jsonThe 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 jsonFilter 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.jsonPagination
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.jsonContinue 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 tableList 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.jsonSave 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.jsonnpx skills add microsoft/skills-for-fabric --skill "search-consumption-cli" --full-depthRun this in your project โ your agent picks the skill up automatically.
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 | Indexing lag is variable and not yet near-real-time โ usually minutes, but not guaranteed. A just-created item may not appear in search results yet; verify it 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. |
Licensed under MITโ you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub โ