fabric-sdk
Skill10 starsChanged 33 days agoMITView on GitHub
How to use @microsoft/fabric-app-data to connect web applications to Fabric data sources at runtime. Build browser-based apps that query semantic models via DAX using the FabricClient API.
8 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 versions8 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★ 646100% same
Wrote their own version · 0
None found.
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-cliSkill
- playwright-cliSkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 184
Integer overflow: If an integer value exceeds ±Number.MAX_SAFE_INTEGER (±9,007,199,254,740,991), the query returns an error with category: …
- Very specific: line 232
All types are exported from the "@microsoft/fabric-app-data" package entry point.
≈ “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 SDK Usage
Overview
@microsoft/fabric-app-data lets web applications query Fabric semantic models at
runtime. The SDK provides a FabricClient that handles querying, result
parsing, caching, and error handling. Transport and authentication are
delegated to an IFabricApiProxy implementation, keeping the SDK
environment-agnostic (browser, Node.js, Fabric extensions).
Quick Start
import { FabricClient } from "@microsoft/fabric-app-data";
const client = new FabricClient({
proxy, // provided by host environment
semanticModels: {
sales: { workspaceId: "...", itemId: "..." },
},
});
const result = await client.semanticModel("sales").query(
"EVALUATE SUMMARIZECOLUMNS(Product[Category], \"Total\", [Sales Amount])"
);
if (result.status === "success") {
// result.table.columns — [{name, dataType}]
// result.table.rows — unknown[][]
} else {
// result.error.category — "api" | "query" | "overflow" | "network" | "unknown"
// result.error.message
}Key Concepts
FabricClient Configuration
The FabricClient is constructed with a config object. The proxy and
connection details are typically provided by the host environment — your
code just needs to pass them through:
new FabricClient({
proxy, // Provided by host environment
semanticModels: { // Named connections
alias: { workspaceId, itemId },
},
cache: { // Optional
enabled: true, // Default: true
maxEntries: 64, // Default: 64 (LRU eviction)
},
});workspaceIdcan be a GUID or"me"for My Workspace items.
Managing Connections
The FabricClient accepts connection config as a plain object. How you
manage those IDs (environment variables, config files, codegen) is up to
your project. The only requirement is that workspaceId and itemId
are provided for each named connection.
const client = new FabricClient({
proxy,
semanticModels: {
sales: { workspaceId: "00c98f7c-...", itemId: "03f2dc11-..." },
},
});Querying
There is one method for DAX queries:
const result = await client.semanticModel("alias").query(dax);
// To skip the cache:
const fresh = await client.semanticModel("alias").query(dax, { bypassCache: true });Result Handling
Always check result.status — queries never throw.
Each query must contain exactly one EVALUATE statement. On success, the
result contains a single table with:
columns:Array<{ name: string, dataType: string }>— column metadatarows:unknown[][]— row-major array, values match column order by index
const result = await model.query("EVALUATE ...");
if (result.status === "success") {
// result.table.columns = [{ name: "Product[Name]", dataType: "String" },
// { name: "[Sales]", dataType: "Int64" }]
// result.table.rows = [["Widget", 42], ["Gadget", 17]]
// result.table.rows[0][0] → "Widget" (matches columns[0])
// result.table.rows[0][1] → 42 (matches columns[1])
} else {
console.error(result.error.message);
// result.error.category: "query" (bad DAX), "overflow" (value too large),
// "api" (HTTP error), "network" (connectivity), "unknown"
}Caching
Results are cached in memory by default (LRU, 64 entries).
const r1 = await model.query("EVALUATE T"); // r1.fromCache === false
const r2 = await model.query("EVALUATE T"); // r2.fromCache === true
// Check cache age
if (r2.fromCache && r2.cachedAt) {
const ageMs = Date.now() - r2.cachedAt.getTime();
}
// Force fresh result
const fresh = await model.query("EVALUATE T", { bypassCache: true });
// Clear cache
client.clearCache(); // all sub-clients
model.clearCache(); // this model onlyWhat gets cached:
- ✅ Success results
- ✅ Query errors (bad DAX — won't fix itself)
- ❌ API errors (401, 500 — transient)
- ❌ Network errors (transient)
Error Categories
| Category | Meaning | Cached? | Example |
query | Invalid DAX syntax | Yes | "Syntax error at position 18" |
overflow | Integer/decimal exceeds safe range | Yes | Value > MAX_SAFE_INTEGER |
api | HTTP error from Fabric | No | 401 Unauthorized, 500 Server Error |
network | Connection failure | No | DNS resolution, timeout |
unknown | Unexpected error | No | Parse failure |
Data Types and DateTime Semantics
The SDK converts all DAX data types to standard JS values:
| DAX type | JS value type | Example |
| Integer (Int64) | number | 42 |
| Double (Float64) | number | 3.14 |
| Currency/Decimal | number | 100.50 |
| Boolean | boolean | true |
| String | string | "hello" |
| DateTime/Date | string (ISO) | "2024-01-15T10:30:00.000" |
| BLANK | null | null |
DateTime values are returned as ISO 8601 strings without a timezone
suffix (no Z, no ±HH:MM). This matches the semantics of Analysis
Services semantic models, where datetimes are timezone-unaware.
// DateTime column values look like:
"2024-01-15T10:30:00.000" // no timezone — interpret as-is
"2023-06-01T00:00:00.000"This format is directly usable as a temporal type in charting libraries
and ensures consistent display across all browser timezones. The JSON and
Arrow protocols both return the same format.
Integer overflow: If an integer value exceeds ±Number.MAX_SAFE_INTEGER
(±9,007,199,254,740,991), the query returns an error with
category: "overflow" rather than silently losing precision.
Common Patterns
Multiple Models
const client = new FabricClient({
proxy,
semanticModels: {
sales: { workspaceId: "ws-1", itemId: "item-1" },
inventory: { workspaceId: "ws-2", itemId: "item-2" },
},
});
const salesResult = await client.semanticModel("sales").query("EVALUATE ...");
const invResult = await client.semanticModel("inventory").query("EVALUATE ...");My Workspace Items
semanticModels: {
myModel: { workspaceId: "me", itemId: "..." },
}Disabling Cache
new FabricClient({
proxy,
cache: { enabled: false },
semanticModels: { ... },
});Anti-Patterns
- Don't catch errors from
query()— it never throws. Checkresult.status. - Don't hardcode endpoint URLs — the proxy handles transport.
- Don't construct
SemanticModelClientdirectly — useclient.semanticModel(alias). - Don't import from internal paths — only import from
"@microsoft/fabric-app-data".
Type Reference
All types are exported from the "@microsoft/fabric-app-data" package entry point.
Key types to import when needed:
import type {
FabricClientConfig,
FabricItemRef,
QueryResult,
CachedQueryResult,
QueryCacheOptions,
QueryTable,
QueryColumn,
QueryError,
} from "@microsoft/fabric-app-data";For full type definitions, see references/types.md in this skill.
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.

