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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kevinglb
Frequent Visitor

Issue - Update Data Source Credentials through REST API failed for Web Source

 

I was trying to update the data source credentials through REST API (https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}) for a PBI report whose data source tpye is "Web" and it is from a CSV file on SharePoint site. I chose "OAuth2" as credential type in the body but got errors as below:

fail.JPG

It says the credentials for the web source are invalid.

 

However I used the same credential type and same token for another PBI report (data source type is "SharePoint List" and they are pointing to the same sharepoint site), and the REST API call was made successfully.

 

Could anyone tell me what's missing during this operation for the websource or is there anything I can do to make the call succeed.

 

 

5 REPLIES 5
IAmStandard
Frequent Visitor

Hi @kevinglb , @v-shex-msft ,

 

I have exactly the same issue. I'm pretty sure it's because we don't patch a "refresh token" with the credential API. When we refresh the dataset, I think it it takes more that x minutes, Power BI Services wants to refresh the token with an access token. Since we didn't put an access token (not supported with the API), it fails.

 

That's pretty annoying because I have no workaround in mind right now...

kevinglb
Frequent Visitor

 We experience issue when we are trying to refresh the PBI report through REST API call: https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshesThe data source for the report is from SharePoint, so it needs data source credentials, we used https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId} to update the credentials by passing access token, and the call succeed, and we can see there is no waning message showing up for that dataset at app.powerbi.com, which means the credentials are updated.

However the refresh result is failed and it says "The credentials provided for the SharePoint source are invalid. " It failed every time when the credentials are updated through the above REST API call.

But if we update the credentials by "Edit Credentials" at app.powerbi.com manually and login with the same account which is used to get the token, the refresh results are always good.

 

Please let me know whether this is a known issue or not and what should I do to make the credentials updated and valid for the report refresh operation.

 

 

Hi @kevinglb,

How did you config 'get data' operations from that data source? Can you please share some more detail to help us clarify and troubleshoot your scenario?

How to Get Your Question Answered Quickly  

In addition, you can take a look at the following link to directly get data from the link of the files that are stored in onedrive/sharepoint:

Use OneDrive for Business links in Power BI Desktop - Power BI | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin,

 

Do you have any progress on this issue?

 

Regards,

Hi Xiaoxin,

 

Followings are the steps that I used to get data from SharePoint:

 

1. Get Data -> SharePoint Folder -> enter the root URL of the site 
2. Click "Transform Data" -> Select the files you want to use by filtering the folder path / extension , then combine them

3. Build visualization model based on the data just loaded and save locally

 

And I also tried the way you suggested through the link to get data by enter the URL of the Excel / CSV file and the data is retrieved same as above method.

 

I believed the problem occurs during the credentials validation process rather than the getting data process for the report.

 

If you can let us know whethere there are known issues for the refresh operation or credentials update operation that will be helpful as we can re-arrange our develppment plan. 

 

Thanks,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.