Forum Discussion
SemanticModels/getDefinition API returns NULL definition body with 202 Accepted & Succeeded status
Hello,
I am using the Fabric REST API for Semantic Models on a Trial Fabric Capacity.
Reading the model metadata works fine:
GET /v1/workspaces/{workspaceId}/semanticModels/{modelId} → 200 OK
But when I call getDefinition:
POST /v1/workspaces/{workspaceId}/semanticModels/{modelId}/getDefinition
→ Returns 202 Accepted
→ I poll the Location URL
→ Status returns "Succeeded"
→ BUT the definition is null/empty
The model is created over a Mirrored SQL Server using Direct Lake mode.
Is this a Trial capacity limitation? Or is there an additional setting/permission I need to enable?
Thank you
Hi deborshi_nag !
Thanks for digging that up , this may explain the behavior and looks like Direct Lake semantic models, particularly those backed by Mirrored SQL Server, simply don't return a usable TMDL definition via the REST API at this time.
For now, Tabular Editor works as a workaround to get/export model defintion , but hopefully Microsoft will address this in a future update.
Really appreciate you taking the time to share the reference!
6 Replies
- deborshi_nagSuper User
Hello IrenaLu
There was a post on the Power BI Developer forum in the past on this topic.
Re: Does getDefinition support DirectLake semantic... - Microsoft Fabric Community
It seems to me that other users have had similar experiences as yours in getting Semantic Model definition created using Direct Lake mode. The REST API response was a null.
I think at this time Direct Lake semantic models—especially those backed by Mirrored SQL Server—do not currently return a usable TMDL definition via the REST API.- IrenaLuNew Member
Hi deborshi_nag !
Thanks for digging that up , this may explain the behavior and looks like Direct Lake semantic models, particularly those backed by Mirrored SQL Server, simply don't return a usable TMDL definition via the REST API at this time.
For now, Tabular Editor works as a workaround to get/export model defintion , but hopefully Microsoft will address this in a future update.
Really appreciate you taking the time to share the reference!
- svenchioSuper User
Hi IrenaLu , it is hunch, but try with /v1/workspaces/{workspaceId}/semanticModels/{modelId}/getDefinition?format={format}
In the past, I have seen the api be a bit picky with some of these! Actually, it happend something similiar with a notebook definition (long story) but I would try first specifing the format ... let us know if it works! (cross my fingers 😋🤞) if it works, mark as solution! Cheers
- IrenaLuNew Member
Hi svenchio ! Thanks for your replay I tried specifying the format explicitly TMSL or TMDL , but unfortunately got the same result either way. So the format parameter doesn't seem to be the culprit here. Still digging into it. if anyone else has run into this, would love to hear what worked! Bests
- v-nmadadi-msftCommunity Support
Hi IrenaLu
I wanted to check if the workarounds suggested by svenchio , deborshi_nag to the issue worked. Please feel free to contact us if you have any further questions.
Thank you. - v-nmadadi-msftCommunity Support
Hi IrenaLu
May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.
Thank you