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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
k-vinh95
Frequent Visitor

Power BI REST API configured the refresh failed

Hello,

 

I'm struggling with configuring the refresh in Power BI service. 

This code works well with Power BI Desktop. When I published my report on the service, I got an issue since I can't configure and refresh the dataset.

 

In my M query, I created 1 function to get the access Token, and 1 call API to get the historical refresh on one Dataset.

 

In Power BI Service : 

I could initialized the getAccessToken. But the API call should not be initialize since it is using the generated token.

gateway.png

 

 

 

 

 

 

 

 

 

 

 

 

In the "data source credentials" field, I tried to configure the credential API call with anonymous but it does not work. So I checked the "skip test the connection".

I did not try to connect with Basic connection type because it is based on the generated token...

datasource credential.png

 

 

 

 

 

 

 

 

 

This is my error below when I try to refresh : 

 

The Error :

{"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":
[ {"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode",
"detail":{"type":1,"value":"-2147467259"}},
{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage",
"detail":{"type":1,"value":"<pi>Web.Contents with the Content option is only supported when connecting anonymously.</pi>"}},
{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2147467259"}},
{"code":"Microsoft.Data.Mashup.ValueError.DataSourceKind","detail":{"type":1,"value":"Web"}},
{"code":"Microsoft.Data.Mashup.ValueError.DataSourcePath",
"detail":{"type":1,"value":"https://login.microsoftonline.com/24139d14-c62c-4c47-8bdd-ce71ea1d50cf/oauth2/v2.0/token"}},
{"code":"Microsoft.Data.Mashup.ValueError.Reason","detail":{"type":1,"value":"DataSource.Error"}}],"exceptionCulprit":1}}}
Table: powerbi_belgique_getRefreshedHistory.

 

 

Do you have any ideas on why it does not work ? 

 

Thank you 

Kevin

1 ACCEPTED SOLUTION

Thank you @GilbertQ  for your reply. 

 

I found the solution, I made a mistake in configuring the MS Token with my own credential.... 

I should have configured with the anonymous type. 

 

Kevin

View solution in original post

3 REPLIES 3
sameer260
Frequent Visitor

Hi,

 

I have a requirement of getting dynamic API url data from GitHub to Power BI. The requirement is getting all the tfsec job failures in all the repos(nearly 1000 repos) and visualzing the count to end user. By using invoke function in Power query I am getting them loaded to Power query but I am unable to get the same data to Power BI desktop (and also it is loading forever). Kindly advise if there is better way of plling GitHub API data into Power BI desktop.

GilbertQ
Super User
Super User

Hi @k-vinh95 

 

The challenge is that the Token changes after 1 hour as it expires so that is why it is not working. For the login I would suggest setting up a service principal and using this to log in?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thank you @GilbertQ  for your reply. 

 

I found the solution, I made a mistake in configuring the MS Token with my own credential.... 

I should have configured with the anonymous type. 

 

Kevin

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.