This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
I'm using the Fabric REST API to retrieve a semantic model definition:
POST /v1/workspaces/{workspaceId}/semanticModels/{semanticModelId}/getDefinitionThis works for Import models, but I'm unsure about DirectLake semantic models.
Does getDefinition fully support DirectLake models?
Has anyone successfully retrieved the definition (TMDL) for a DirectLake semantic model using this API?
Thanks!
Solved! Go to Solution.
Hi @jaryszek ,
The current API behavior is as expected. The getDefinition endpoint may not consistently return a definition for DirectLake semantic models created directly on a Lakehouse, since the model is not always stored as a fully serialized definition. Much of the metadata is dynamically derived from the underlying Delta tables, which can result in the API returning null even when the request completes successfully. This does not indicate a failure.
Currently, there is no REST API that guarantees a non-null definition for DirectLake models. If you need a reusable model definition for automation or copy scenarios, it is more reliable to use models deployed through XMLA or similar methods where the definition is fully persisted.
For copy or deployment scenarios involving DirectLake, it is recommended to use the XMLA endpoint or external tools to script or recreate the model, rather than relying on getDefinition. If this approach does not fit your requirements or you need this capability via REST, please consider submitting a Microsoft support ticket for further assistance.
To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide: How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn.
Thank you.
thank you,
I tested it and got null as an answer (202). So it means that DirectLAke over OneLake is not working with this rest api. Any alternatives?
Best,
Jacek
Hi @jaryszek ,
Receiving a 202 response from the getDefinition API does not mean that DirectLake semantic models are unsupported. In the Fabric REST API, this endpoint works as a long-running operation. A 202 Accepted response indicates that the request has been received and processing has started, but the definition is not yet ready, so the response body may be empty at this point.
The usual process is to use the operation details provided in the response headers, like the operation ID or location, and then check the operation status endpoint. Once the operation completes, you can retrieve the result, which will include the semantic model definition in TMDL format. This process is the same for Import, DirectQuery, or DirectLake storage modes.
The official documentation for the Fabric REST API Get Semantic Model Definition and the general guidance on long-running operations confirm that a 202 response means processing is underway and clients should poll the operation endpoint for the result.
Therefore, DirectLake over OneLake is not blocked by the API. The important step is to follow the long-running operation pattern after receiving the 202 response, rather than expecting the definition immediately. By doing this, you can retrieve the TMDL for the semantic model.
Thank you.
@jaryszek If you got 202 (Accepted) it doesn't mean it is not working. See here how to get the result of a long running operation in Fabric APIs
Long running operations - Microsoft Fabric REST APIs | Microsoft Learn
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |