Forum Discussion
Does getDefinition support DirectLake semantic models?
- 4 months ago
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.
Hi jaryszek ,
Based on your summary, the original poster is seeking confirmation on whether the Fabric REST API endpoint used to retrieve a semantic model definition works for DirectLake semantic models, in addition to Import mode models. They are already using the API endpoint successfully with Import mode and are uncertain if it supports DirectLake models, specifically for retrieving the TMDL definition. Currently, there is no Super User response in the thread addressing this question, so there is no answer to validate, and the correct status remains None 0%.
According to Microsoft documentation, the getDefinition API is intended to return the public definition of a semantic model item, regardless of the storage mode DirectLake, Import, or DirectQuery. The API retrieves the definition as long as the model exists in the workspace and the user has the necessary permissions. The storage mode does not affect the endpoint’s functionality. This is supported by the Fabric REST API documentation, which confirms that the endpoint returns the semantic model definition for the specified item.
A suitable forum response would be: Yes, the getDefinition endpoint is compatible with DirectLake semantic models. The API retrieves the definition of the semantic model item itself, and the storage mode does not impact this process. Provided you have the necessary permissions and the model exists in the workspace, the API will return the model definition in TMDL format. Any issues encountered are typically related to permissions or the type of semantic model item, rather than the DirectLake storage mode.
Thank you.
- jaryszek5 months agoSuper User
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- AmosHersch5 months agoMicrosoft Employee
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 - v-tejrama5 months agoCommunity Support
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.