Forum Discussion
Does getDefinition support DirectLake semantic models?
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!
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.
23 Replies
- v-tejramaCommunity Support
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.- jaryszekSuper 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- AmosHerschMicrosoft 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
- jaryszekSuper User
thank you AmosHersch v-tejrama
Are you sure that DiretLake over OneLake after the result of LRO will have something?
In my case it was always null.
Can you pleasecheck the scenario in your case?
Best,
Jacek - jaryszekSuper User
Has anyone had a similar case and can confirm based on real experience, not docs?
Best,
Jacek- v-tejramaCommunity Support
Hi jaryszek ,
Thank you for reviewing this and sharing your test results. The behavior you observed has also been reported by others in the community. When a long-running operation completes successfully, the getDefinition endpoint may still return a null definition for semantic models using DirectLake over OneLake.
This differs from Import or DirectQuery models, where the TMDL definition is typically available after the operation finishes. Based on your results, there does not appear to be an issue with your API call rather, it is related to how the REST endpoint handles definitions for this storage configuration. Currently, there are few confirmed cases of the API returning a populated TMDL definition for DirectLake over OneLake models, so your experience aligns with existing feedback.
As a workaround, some users retrieve metadata through the XMLA endpoint or tools like Tabular Editor, which can script the semantic model even if the REST API returns a null definition. If anyone has successfully obtained a populated result for DirectLake models using this endpoint, their insights would be valuable.
Thank you.- jaryszekSuper User
Thanks,
"Currently, there are few confirmed cases of the API returning a populated TMDL definition for DirectLake over OneLake models" do you nkow what is different in those models where definition is there than others?