Forum Discussion
Connecting Semantic Model to Cloud Data Source via API
As of the last update, the official Power BI REST API documentation does not explicitly document the process of managing cloud data source connections directly through the Power BI REST API, including the process of programmatically assigning those connections to semantic models.
While there may not be documentation support for the specific endpoint you want to query.
However, the Power BI REST API provides the following methods for updating data source credentials and updating data sources.
Gateways - Update Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Datasets - Update Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn
I also found some relevant documentation on how to create and share cloud data sources and connect to cloud data sources in power bi service.
Create and share cloud data sources in the Power BI service - Power BI | Microsoft Learn
Connect to cloud data sources in the Power BI service - Power BI | Microsoft Learn
I hope you find it helpful.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply. I have been using the update datasource enpoints to update the username and password previously, but I can't find a way to list the "gateways" for the cloud data sources. I have tried the https://api.powerbi.com/v1.0/myorg/gateways endpoint and it returns an empty list. If I pull a semantic model which is already connected to the cloud datasource, the result does contain a gatewayId, but when I then try to get that gateway using https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}, I get a 404 result.