PowerBI API Rest API for updating the Datasource ID

0 votes
PowerBI API Rest API for updating the Datasource ID?

I'm working on a project that requires updating the data source ID for a dataset in Power BI, and I understand that this can be achieved using the Power BI REST API. Specifically, I need to understand how to authenticate, access, and utilize the correct API endpoints to update the data source ID efficiently without manual intervention through the Power BI interface.

Is there a step-by-step guide or best practices on using the REST API for this task? If so, I’d appreciate guidance on setting up authentication, finding the data source ID, and executing the API calls to automate this update process.
Oct 29 in Power BI by Evanjalin
• 5,530 points
25 views

1 answer to this question.

0 votes

To replace the data sourced in Power BI via REST API, here’s what you should do:

  • Get the Dataset ID: First of all, make sure you have the datasetId of the Power BI dataset which you want to change. You can achieve that by calling:
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets

In this case, you need to replace the {groupId} with your workspace ID. 

  • Identify the Current Data Source: After obtaining the datasetId, verify the available data sources by invoking the following:
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/datasources

A consequence of the preceding is that it generates the data sources tied to that particular dataset such as the one with the datasourceId that you would like to change.

  • Datasource Updating: In case you wish to change the proposed datasourceId, do the following request and provide details regarding the new data source in the body:
PATCH https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.UpdateDatasources
  • Authentication: Always bear in mind that use of the Power BI REST API means use of OAuth 2.0. Make sure that the app has been granted the needed permissions (Dataset.ReadWrite.All) and a token has been received before attempting to make any requests.

These steps will assist you in successfully changing the datasourceId for a dataset present in Power BI.

answered Oct 29 by pooja
• 4,690 points

Related Questions In Power BI

0 votes
0 answers

PowerBI API Rest API for updating the Datasource ID?

PowerBI API Rest API for updating the ...READ MORE

Oct 25 in Power BI by Evanjalin
• 5,530 points
34 views
0 votes
0 answers
+1 vote
1 answer

Have column with multiple values in powerBI, for use with a slicer in power bi

It can be achieved depending on the result you ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 18,520 points
7,445 views
+1 vote
1 answer

Show the latest value in PowerBi from ASA

Best you can do right now is ...READ MORE

answered Oct 25, 2018 in Power BI by Surendra
1,568 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,311 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,130 points
2,722 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,492 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Yes using Power BI REST API to ...READ MORE

answered Sep 18, 2018 in Power BI by Kalgi
• 52,350 points
1,646 views
0 votes
1 answer

How can I leverage the Power BI REST API for automated report deployment and management within my organization?

To ensure easier deployment and maintenance of ...READ MORE

answered Nov 14 in Power BI by pooja
• 4,690 points
19 views
+2 votes
1 answer

What are the best practices for creating calculated columns versus measures in Power BI?

Use Calculated Columns for Static Row-Level Calculations. ...READ MORE

answered Oct 21 in Power BI by pooja
• 4,690 points
69 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP