Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Dinz
Regular Visitor

Connecting and Updating the SQL Endpoint of a Report’s Semantic Model Using a Notebook

Hi everyone,

Is there a way to update a report’s semantic model SQL endpoint from one Lakehouse to another?
Currently, my semantic models are connected to the Lakehouse using a Direct Lakehouse connection.

 

I tried exploring options with sempy, but couldn’t find a straightforward way to modify or repoint the connection.
Is there a simple method to achieve this?

 

There’s one limitation — I can’t install any additional libraries.

1 ACCEPTED SOLUTION

Hi @Dinz 


Your flowchart provides a clear automation pipeline that effectively identifies semantic models not pointing to the correct Lakehouse SQL endpoint and updates them using TMOSL manipulation. Considering current platform limitations, this is both a practical and supported approach.

To enhance your workflow, consider parsing the decoded TMOSL JSON to update connectionDetails or expression nodes directly, rather than using regex replacements. This can help prevent syntax errors and simplify ongoing maintenance.

While SemPy cannot modify connections, it is useful for validating TMOSL structure prior to redeployment. For multiple updates, batching POST requests and polling them in parallel can reduce latency. Maintaining an audit log with model names, endpoint changes, and operation statuses will improve traceability.

Additionally, caching the Gold Lakehouse endpoint and semantic model list can decrease redundant API calls and boost performance. Your REST API-based solution follows best practices, and these recommendations can further strengthen its robustness and maintainability.

 


I hope this information is helpful. If you have any further questions, please let us know. we can assist you further.

 

Regards,

Microsoft Fabric Community Support Team.

 




View solution in original post

6 REPLIES 6
v-karpurapud
Community Support
Community Support

Hi @Dinz 

Thank you for contacting the Microsoft Fabric Community.
 

At this time, notebooks do not provide a direct way to update or repoint the SQL endpoint of a semantic model connected through Direct Lakehouse mode. The connection metadata for the semantic model is managed internally and cannot be changed via SemPy or other notebook-based solutions. Since tools such as Tabular Editor are not allowed in your environment, the best course of action is to manually recreate the semantic model with the new Lakehouse connection.

For additional information, please refer to the official Microsoft documentation at http://learn.microsoft.com/en-us/fabric/fundamentals/direct-lake-overview

 

Should you have any further questions, please let us know and we will be happy to assist.

 

Regards,

Microsoft Fabric Community Support Team

 

Hi @v-karpurapud  Our organization is currently using the "https://api.fabric.microsoft.com/v1/" endpoints to handle this process. I’ve been working on simplifying the workflow, and the Mermaid flowchart below illustrates the approach we’ve implemented so far. I’d like to know if there’s a more streamlined or efficient way to achieve this. Any suggestions or best practices would be greatly appreciated.

 

flowchart TD
A[Start] --> B[Get list of Lakehouses + Warehouses]
B --> C[Find Gold Lakehouse SQL endpoint]
C --> D[Get all Semantic Models]
D --> E{Model name NOT in lakehouse list?}
E -->|Yes| F[Download model definition (TMOSL)]
F --> G[Base64-decode expressions.tmdl]
G --> H[Regex-replace Sql.Database(...) with Gold endpoint]
H --> I[Base64-encode updated TMOSL]
I --> J[POST updated definition (async)]
J --> K[Poll operation until Succeeded]
E -->|No| L[Skip – already correct]
K --> M[Done]

Hi @Dinz 


Your flowchart provides a clear automation pipeline that effectively identifies semantic models not pointing to the correct Lakehouse SQL endpoint and updates them using TMOSL manipulation. Considering current platform limitations, this is both a practical and supported approach.

To enhance your workflow, consider parsing the decoded TMOSL JSON to update connectionDetails or expression nodes directly, rather than using regex replacements. This can help prevent syntax errors and simplify ongoing maintenance.

While SemPy cannot modify connections, it is useful for validating TMOSL structure prior to redeployment. For multiple updates, batching POST requests and polling them in parallel can reduce latency. Maintaining an audit log with model names, endpoint changes, and operation statuses will improve traceability.

Additionally, caching the Gold Lakehouse endpoint and semantic model list can decrease redundant API calls and boost performance. Your REST API-based solution follows best practices, and these recommendations can further strengthen its robustness and maintainability.

 


I hope this information is helpful. If you have any further questions, please let us know. we can assist you further.

 

Regards,

Microsoft Fabric Community Support Team.

 




thank you @v-karpurapud for letting me know

Thomaslleblanc
Super User
Super User

ve you tried using Tabular Editor?

i cannot use any other external tools as well @Thomaslleblanc i can only use notebooks alone

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.