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

Issue - Credentials are invalid for source during refresh PBI report through REST API

 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 successfully.

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

Status: Investigating

Hi @kevinglb,

 

May I know if you refresh the dataset from Power BI service after updating the credential by calling update credential api, wil you refresh successfully? If retry the refresh several times, will it fail as either?  

 

There is an known issue may be related to this issue, but I’m not very sure: Power BI users using OAuth authentication to refresh their report\datasets may see intermittent refresh failures. And normally, refresh can be performed by Retry the refresh operation.

 

Best Regards,                                                   

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @kevinglb,

 

May I know if you refresh the dataset from Power BI service after updating the credential by calling update credential api, wil you refresh successfully? If retry the refresh several times, will it fail as either?  

 

There is an known issue may be related to this issue, but I’m not very sure: Power BI users using OAuth authentication to refresh their report\datasets may see intermittent refresh failures. And normally, refresh can be performed by Retry the refresh operation.

 

Best Regards,                                                   

Community Support Team _ Caiyun

kevinglb
Frequent Visitor

Hi @v-cazheng-msft ,

 

Thanks for the reply.

Well I tried calling REST API https://api.powerbi.com/v1.0/myorg/groups/%7BgroupId%7D/datasets/%7BdatasetId%7D/refreshes to refresh the dataset, guess that's a kind of ways to refresh from Power BI Service? And for most of time I got failure in refreshing after updating the credential by calling update credential api, doesn't matter how many times I refreshed.

 

But as I posted, the refresh operation will work once I updated credential manually by login with an account.

 

Is there difference between those two update operations? It seems the credentials is correct after updated but not be used correctly for refresh operation.

 

kevinglb
Frequent Visitor

Hi @v-cazheng-msft,

 

May I ask how far have you gone with the know issue since last comment? Any imporveoment or any other operation we can do?

 

Regards,

IAmStandard
Frequent Visitor

Hi @kevinglb , @v-cazheng-msft ,

 

I also have this issue, espacially when trying to refresh data from "big" files stored in SharePoint (not that big, around 100MB).

 

My best guess is that we don't pass a refresh token to the credential API (not supported), maybe Power BI Services tries to get a new token during the refresh and can't do that because we passed only an access token ?

 

I managed to successfully refresh many other datasets with the exact same method so I think this is it. Any workaround in mind ?

 

Thanks !