Forum Discussion

nipunm's avatar
nipunm
New Member
1 year ago
Solved

Changing Semantic Model Connection Mapping for Fabric Lakehouse SQL Endpoint Using REST API

Hello Power BI Community, I have published a Power BI model using the REST API with an AAD/SPN. However, the model is currently pointing to a Fabric Lakehouse SQL Endpoint, which defaults to single ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, nipunm 

    Thank you for your prompt response. I now have a better understanding of your requirements and have made timely adjustments to the solution:

     

    1.Firstly, I created the following example, with its relational view as shown below:

    It encountered a similar issue to yours:

    2.Secondly, we can observe that the creatable gateway connection is a cloud gateway.
     

    Currently, using the API to create a data connection requires a gatewayid, and most REST APIs do not support cloud gateways and virtual gateways. Below is a screenshot from the official documentation:

    For further details, please refer to:

    Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    Therefore, directly using the API to create a data connection is not feasible, which was a misunderstanding on my part regarding your issue.

     

    3.We recommend using the following API to add users to your workspace and manually add the gateway:

    POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/users
    

    Below is the request body:

    {
      "emailAddress": "[email protected]",
      "groupUserAccessRight": "Admin"
    }
    

    4.The corresponding content to be added is:

    You may need to ensure that your service principal is assigned a role in the workspace where your lakehouse is located.

     

    5.Below are the final results:


    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.