fabric-cli
Skill10 starsChanged 32 days agoMITView on GitHub
How to use fabric-app-data CLI to manage Fabric data source connections. Maintain workspace/item IDs in a fabric.yaml file with profiles, add connections by ID or Fabric portal URL, and generate TypeScript config for use with @microsoft/fabric-app-data.
9 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- microsoft/DataHub-App-for-Microsoft-Copilot-Agents-Cowork-and-Autopilotsword for word, first seen Nov 8, 2026
- microsoft/ValueLens-for-Microsoft-Copilotword for word, first seen Oct 25, 2026
- microsoft/ConsumptionCentral-for-Microsoft-Copilotword for word, first seen Oct 25, 2026
- microsoft/frontiertour27-LTG291-turn-your-data-into-production-apps-with-rayfinword for word, first seen Oct 17, 2026
- microsoft/frontiertour27-BRK390-building-ai-applications-with-microsoft-databases-and-fabricword for word, first seen Oct 17, 2026
- microsoft/rayfinedited, first seen Oct 13, 2026
Used with
Projects with it also use rayfin-functions.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillrayfin-functions
Use when writing Rayfin user-defined functions (UDFs), invoking functions from frontend code, or using functions CLI commands. Triggers: rayfin functions, udf.func, UserDataFunctions, RayfinContext, FabricContext, AppFunctionsSchema, functions init, dev functions apply, client.functions, invoke, func start, function_app.ts, types.ts, rayfin/functions/, FunctionClient, FunctionsSchema, fabric-user-data-functions, functionsBaseUrl, VITE_RAYFIN_FUNCTIONS_URL, bootstrap.ts, rayfinClient.ts
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 7
- microsoft/ConsumptionCentral-for-Microsoft-Copilot★ 33100% same
- microsoft/ValueLens-for-Microsoft-Copilot★ 23100% same
- microsoft/DataHub-App-for-Microsoft-Copilot-Agents-Cowork-and-Autopilots★ 10100% same
- microsoft/aitour27-LTG291-turn-your-data-into-production-apps-with-rayfin★ 2100% same
- microsoft/frontiertour27-LTG291-turn-your-data-into-production-apps-with-rayfin★ 2100% same
- microsoft/aitour27-BRK390-building-ai-applications-with-microsoft-databases-and-fabric★ 1100% same
- microsoft/frontiertour27-BRK390-building-ai-applications-with-microsoft-databases-and-fabric★ 1100% same
Edited · 1
- microsoft/rayfin★ 64694% same
Wrote their own version · 1
- tristanmanchester/agent-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- app/AGENTS.mdAGENTS.md
- app-designSkill
- app-validationSkill
- dax-authoringSkill
- fabric-sdkSkill
- playwright-cliSkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
All commands except init walk up the directory tree from the current working directory until they find a fabric.yaml.
- Very specific: line 52
Create a new fabric.yaml in the current directory.
- Distinctive: line 62
Add a connection to a profile.
- Very specific: line 78
Important: Prefer the short flags -w and -i (long forms --workspace and --item).
- Distinctive: line 125
Remove a connection by alias.
- Very specific: line 217
Add fabric.generated.ts to .gitignore — regenerate from fabric.yaml as needed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fabric CLI — Connection Management
Overview
The fabric-app-data CLI manages Fabric data source connections in a
fabric.yaml file. It supports multiple profiles (dev, staging,
production) and generates TypeScript config that the @microsoft/fabric-app-data
consumes at runtime.
Workflow
npx fabric-app-data init # 1. Create fabric.yaml
npx fabric-app-data add sales --from-url "https://app.fabric.microsoft.com/..."
# 2. Add connections
npx fabric-app-data generate -o src/fabric.generated.ts
# 3. Generate TypeScript configThen in your app:
import { FabricClient } from "@microsoft/fabric-app-data";
import { fabricConfig } from "./fabric.generated.js";
const client = new FabricClient({ proxy, ...fabricConfig });Config discovery
All commands except init walk up the directory tree from the
current working directory until they find a fabric.yaml. This means
you can run the CLI from any subdirectory of your project (e.g. from
src/queries/ or a nested package) and it will pick up the project's
root fabric.yaml automatically.
init is the exception — it always writes fabric.yaml to the
current working directory, so run it from the project root.
Commands
npx fabric-app-data init
Create a new fabric.yaml in the current directory.
npx fabric-app-data init # default "dev" profile
npx fabric-app-data init -p production # custom profile name
npx fabric-app-data init --force # overwrite existingnpx fabric-app-data add
Add a connection to a profile. Two modes:
From Fabric portal URL (preferred when the user pastes a URL):
npx fabric-app-data add <alias> --from-url "<Fabric portal URL>"Explicit IDs (use this after search to register a chosen result):
npx fabric-app-data add semanticModel <alias> -w <workspaceId> -i <itemId>To register a model the user named (rather than linked), run search first,
pick the right row, then call add with that row's -w/-i. add never
searches — discovery and registration are separate steps.
Important: Prefer the short flags -w and -i (long forms --workspace and --item). Use one consistent style per command.
The URL parser extracts workspace ID, item ID, and type automatically.
Supported URL segments: semanticmodels, modeling, lakehouses,
warehouses. "me" is accepted as workspace ID for My Workspace items.
Options:
-p, --profile <name>— target profile (defaults to active)
npx fabric-app-data search
Find a semantic model by display name via the Fabric Catalog Search endpoint.
Useful when the user knows the model name but not the workspace + item ids.
search only returns results — it never registers a connection; follow it
with add -w <workspaceId> -i <itemId>.
npx fabric-app-data search "<name>"
npx fabric-app-data search "<name>" --json # machine-readable output (preferred for agents)
npx fabric-app-data search "<name>" -w "<workspace>" # restrict to one workspace (name or GUID)
npx fabric-app-data search "<name>" --max-results 5Options:
--type <type>— scope the search to a Fabric item type (defaultsemanticModel). The type is forwarded to Catalog Search, which returns whatever item types it supports.-w, --workspace <nameOrId>— restrict results to a single workspace (display name or GUID)--max-results <n>— cap on hits returned (default 10, hard cap 50)--json— emit machine-readable JSON
Caveats — read before using:
- Catalog Search is fuzzy and tokenized. It never returns empty for any
query — even nonsense strings produce ranked hits. A non-empty response does
not imply a confident match. Always reason over the
displayNamevalues before adding a connection. - Exit code is
0when at least one hit is returned,1when none are. Use this to branch in scripts. - Items in your personal My workspace come back with
workspaceIdset to themesentinel — pass-w metoadd(and toquery), since My Workspace has no separate workspace GUID in the Fabric APIs. - JSON output (
--json) is the preferred format for agents: it includessource(catalog/none),workspaceFilter,truncated, and a normalizedresults[]shape (itemId,itemType,displayName,description,workspaceId,workspaceName) — enough metadata to disambiguate same-named models in different workspaces.
npx fabric-app-data remove <alias>
Remove a connection by alias.
npx fabric-app-data remove sales
npx fabric-app-data remove sales -p stagingnpx fabric-app-data list
List all connections in a profile.
npx fabric-app-data list
npx fabric-app-data list -p productionnpx fabric-app-data use <profile>
Switch the active profile and auto-regenerate the config file.
npx fabric-app-data use production
npx fabric-app-data use staging -o src/config/fabric.generated.tsnpx fabric-app-data generate
Generate fabric.generated.ts from the active profile.
npx fabric-app-data generate
npx fabric-app-data generate -o src/fabric.generated.ts
npx fabric-app-data generate -p productionnpx fabric-app-data query
Execute a DAX query against a semantic model using the same SDK pipeline as the running app. Aliases: execute, exec.
npx fabric-app-data query <alias> --query '<DAX>'
npx fabric-app-data query <alias> --file src/queries/revenue.dax
npx fabric-app-data query semanticModel <alias> --query '<DAX>' # explicit source type
npx fabric-app-data query <alias> --query '<DAX>' --limit 50 # return at most 50 rows
npx fabric-app-data query <alias> --query '<DAX>' --profile stagingOptions:
-q, --query <query>— inline DAX query text-f, --file <path>— path to a.daxfile (alternative to--query)-l, --limit <rows>— maximum rows to return (default: 1000, max: 1000)-p, --profile <name>— profile name (defaults to activeProfile)
Result trimming: By default, results are capped at 1000 rows to keep output manageable. When the result is trimmed, the JSON output includes a _cliWarning field indicating how many rows were returned out of the total. This is a CLI-only limitation — the full dataset is available in the running app. If more rows are needed, refine the DAX query with filters or aggregations instead.
fabric.yaml Structure
activeProfile: dev
profiles:
dev:
semanticModels:
sales:
workspaceId: "00c98f7c-..."
itemId: "03f2dc11-..."
myModel:
workspaceId: "me"
itemId: "c078a68d-..."
production:
semanticModels:
sales:
workspaceId: "aabbccdd-..."
itemId: "11223344-..."Generated Output
fabric.generated.ts exports a plain config object:
// fabric.generated.ts — AUTO-GENERATED from fabric.yaml (profile: dev). Do not edit.
export const fabricConfig = {
semanticModels: {
sales: {
workspaceId: '00c98f7c-...',
itemId: '03f2dc11-...',
},
},
} as const;Add fabric.generated.ts to .gitignore — regenerate from fabric.yaml
as needed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

