Forum Discussion

Charline_74's avatar
Charline_74
Resolver I
2 months ago
Solved

Automatically update the connection for a semantic model after deploying it

Hello, 

 

I'm looking for a way to automatically change the connection for a semantic model connected to a lakehouse in Azure Data Lake Storage mode.

Are there any APIs...

Thanks in advance,

  • Hi Charline_74 , Thank you for reaching out to the Microsoft Community Forum.

     

    There is no dedicated REST API that can directly update or rebind the Lakehouse connection for a Direct Lake semantic model after deployment. Direct Lake semantic models work differently from traditional Import or DirectQuery models, so the standard datasource update APIs are generally not applicable here.

     

    Automation can be done through metadata changes using TMDL, TOM/TMSL/XMLA or SemPy/Semantic Link scripting as part of a CI/CD process. In practice, many teams either maintain environment-specific semantic models or automate the replacement of Lakehouse references during deployment.

6 Replies

  • Hi  Charline_74 

    I am not fully certain, but at the moment there is no direct REST API that allows you to edit the connection of a Direct Lake semantic model after it has been deployed. The connection to a Lakehouse cannot be changed through the Data source settings in the Power BI Service, as Direct Lake models do not use traditional connection strings or credentials. For this reason, automation is only possible by manipulating the semantic model definition using TMDL or TMOSL, or by using Semantic Link, also known as SemPy.
    When Git integration and Deployment Pipelines are in place, the most robust and maintainable approach is to use parameters defined at the model level in TMDL. In this setup, environment‑specific values such as the Lakehouse name or the Workspace ID are abstracted into parameters, which makes the semantic model portable across environments without changing its structure.
    In practice, the parameters are defined in the model.tmdl file and then referenced inside the Direct Lake expressions. During deployment, only the parameter values need to be updated for each environment. These changes are committed to Git and then deployed automatically through the pipeline, which provides a clean and repeatable CI/CD process.
    A simplified example of a model definition with parameters could look like the following:

     

    model {
      parameter LakehouseName = "lh_dev"
      parameter WorkspaceId  = "abc123"
    }

     

    With this approach, the semantic model logic remains the same across development, test, and production environments. Only the parameter values differ, which reduces manual effort, limits the risk of errors, and aligns well with current Microsoft Fabric best practices for Direct Lake semantic models.

     

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Charline_74 , Thank you for reaching out to the Microsoft Community Forum.

     

    There is no dedicated REST API that can directly update or rebind the Lakehouse connection for a Direct Lake semantic model after deployment. Direct Lake semantic models work differently from traditional Import or DirectQuery models, so the standard datasource update APIs are generally not applicable here.

     

    Automation can be done through metadata changes using TMDL, TOM/TMSL/XMLA or SemPy/Semantic Link scripting as part of a CI/CD process. In practice, many teams either maintain environment-specific semantic models or automate the replacement of Lakehouse references during deployment.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Charline_74 , Hope you are doing well. Kindly let us know if the issue has been resolved or if further assistance is needed. Your input could be helpful to others in the community.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Charline_74 , Hope you're doing fine. Can you confirm if the problem is solved or still persists? Sharing your details will help others in the community.

  • I don't think there's a direct API to swap a semantic model's Lakehouse connection. Most people handle this through deployment pipelines, REST APIs, or XMLA (where supported) as part of the deployment process. If you can share your setup and what you're trying to repoint, someone can suggest the best approach.