fabric-tmdl-api
Skill1 starsChanged 56 days agoMITView on GitHub
Use for the Fabric Semantic Model Definition API — createItemWithDefinition / getDefinition / updateDefinition. Covers the two-audience rule (Fabric API for definitions, Power BI API for refresh/data sources/permissions), why updateDefinition MUST include ALL parts (modified and unmodified) or they're deleted, why you NEVER include .platform in definition payloads, base64 encoding requirement, LRO polling, required TMDL parts (definition.pbism, database.tmdl, model.tmdl, tables/*.tmdl), the `database` declaration requirement in database.tmdl, and Direct Lake partition configuration (EntityPartitionSource, named expression with AzureStorage.DataLake).
In this repository62 other files it gives its agents.
- claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- author-skillSkill
- drift-auditSkill
- drift-handoffSkill
- drift-updateSkill
- test-skillSkill
- triageSkill
- fabric-activatorSkill
- fabric-ai-functionsSkill
- fabric-authSkill
- fabric-catalog-governanceSkill
- fabric-cicdSkill
- fabric-cliSkill
- fabric-copy-jobSkill
- fabric-data-agentSkill
- fabric-databaseSkill
- fabric-dataflowSkill
- fabric-data-pipelineSkill
- fabric-deployment-pipelinesSkill
- fabric-error-handlingSkill
- fabric-eventhouseSkill
- fabric-event-schema-setSkill
- fabric-eventstreamSkill
- fabric-gotchasSkill
- fabric-graphSkill
- fabric-mirroringSkill
- fabric-mlvSkill
- fabric-ontologySkill
- fabric-operations-agentSkill
- fabric-realtime-dashboardSkill
- fabric-rest-apiSkill
- fabric-securitySkill
- fabric-semantic-model-ai-instructionsSkill
- fabric-semantic-model-auditSkill
- fabric-spark-monitoringSkill
- fabric-sparkSkill
- fabric-tmdlSkill
- fabric-variable-librarySkill
- fabric-warehouse-monitoringSkill
- fabric-warehouseSkill
- learnSkill
- pbid-tom-liveSkill
- pbip-project-structureSkill
- pbir-bookmarksSkill
- pbir-cliSkill
- pbir-conditional-formattingSkill
- pbir-filtersSkill
- pbir-pagesSkill
- pbir-report-workflowSkill
- pbir-themesSkill
- pbir-visual-jsonSkill
- powerbi-report-authoringSkill
- powerbi-report-designSkill
- linkedin-highlightsSkill
- msix-packagingSkill
- code-reviewSkill
- commitSkill
- find-sessionSkill
- landSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
ALL partitions must use EntityPartitionSource — no M/Power Query
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Semantic Model Definition API rules
- Two audiences: Fabric API (
api.fabric.microsoft.com) for CRUD on definitions; Power BI API (analysis.windows.net/powerbi/api) for refresh, data sources, permissions updateDefinitionmust include ALL parts — modified AND unmodified. The API replaces the entire definition; omitting parts deletes them.- Never include
.platforminupdateDefinitionpayloads — it is Git integration metadata and causes errors. Bulk Import is the exception: its parts carry each item's.platform - Base64-encode all TMDL content in definition payloads
getDefinitionis a POST (not GET) — requires--body '{}'- Poll LRO to completion —
createItemWithDefinition,getDefinition, andupdateDefinitionreturn 202
Required TMDL Parts
| Part Path | Content |
definition.pbism | Semantic model connection settings (JSON) |
definition/database.tmdl | database declaration + compatibilityLevel: 1702 |
definition/model.tmdl | Model properties + ref declarations for tables/roles/etc. |
definition/tables/<TableName>.tmdl | Per-table: measures, columns, partitions |
Critical: database.tmdl MUST start with database object declaration, not bare properties. Bare compatibilityLevel: causes InvalidLineType: Property! errors.
model.tmdl Required Properties
model Model
culture: en-US
defaultPowerBIDataSourceVersion: powerBI_V3
discourageImplicitMeasuresdefaultPowerBIDataSourceVersion: powerBI_V3 is required for Import-mode models. Without it: Import from JSON supported for V3 models only.
Direct Lake Configuration
- ALL partitions must use
EntityPartitionSource— no M/Power Query A named expression pointing to the Lakehouse/Warehouse must be defined before tables:
expression DL_Lakehouse = let Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/<WorkspaceId>/<LakehouseId>", [HierarchicalNavigation=true]) in SourceEach table partition references the expression:
partition Sales = entity mode: directLake source entityName: Sales schemaName: dbo expressionSource: DL_LakehousedataType: binarycolumns are NOT supported in Direct Lake- Columns map directly via
sourceColumn— no transforms - Calculated columns / tables (April 2026 preview): Direct Lake on OneLake now supports unmaterialized calculated columns (and calculated tables that reference them). Direct Lake on SQL still does not. User-context-aware DAX (
USERCULTURE,USERPRINCIPALNAME,CUSTOMDATA, etc.) requiresexpressionContext: userContexton the column. Authorable in Power BI Desktop and web modeling, without changing storage mode. See fabric-tmdl REFERENCE for the storage-mode × Expression-Context support matrix.
Reference
- Microsoft Learn: Item definition overview (Fabric REST)
- Microsoft Learn: SemanticModel definition envelope
- Microsoft Learn: Develop Direct Lake semantic models (TMDL partition mode)
- Comprehensive MS Learn link bundle (definition envelope / REST CRUD / TMDL language / required parts / Direct Lake configuration / refresh APIs): references/REFERENCE.md
See also
- fabric-rest-api skill — LRO polling pattern, runtime item ID vs logicalId
- fabric-auth skill — Fabric vs Power BI audience selection
- fabric-cli skill —
fab export/fab importwrap these APIs
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.

