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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ECorona
Advocate I
Advocate I

Issue with refresh token (created with OAuth2) in Power BI Desktop and Service in a Custom Connector

Hello community,

I have developed a custom connector for the company I work for; this connector is distributed to the users that purchase other software suite we made and that is used to generate the data that the users can consult using the connector.

A few days ago, some of our users started to report that their reports that are on Power BI service cannot be updated. So, our dev team started to investigate what was happening. We were able to replicate the issue and found the next things:

In Power BI Desktop:

Our connector uses the OAuth2 authentication process (following the documentation displayed here: Handling authentication for Power Query connectors - Power Query | Microsoft Learn) to authenticate the users in their servers (where the software we made is running).

Once authenticated, we select the desired tables in the Navigator window and can use that data to transform it or create the report, everything is normal at this point.

But if the user wants to perform a refresh of the data using the “Refresh” button that is in the Queries section of the “Home” ribbon, the credentials have expired and need to sign-in again.

ECorona_0-1754669502296.png


We have implemented the Refresh function to request a new token when that button is pressed, and as I mentioned earlier this used to work properly (this connector has been created and shared to our user base in the last 2 years ago, but this is issue is being experiencing from this week)

But this the strange part, if I close this authentication dialog with the “X” button and press the “Refresh” button again the new token is created, and the data is refresh without the need of sign in (as I expected)

Looking at fiddler to see what’s happening, I’m getting an error 400, I’m having 3 tables

ECorona_1-1754670055705.png

Repeating the experiment I have found that every table is being treated as an individual data source but with the same refresh token at the same time, in this case with 4 tables, the first table uses the refresh token to get a new access token and everything is Ok, but for the other 3 tables the refresh toke is already used and that leads into the error 400.

 

ECorona_2-1754671099717.png

 

 

When I press the Refresh token a second time, I have the access token from the first table in the first click and therefore the refresh is done without problems this time and without the need of sign-in again.

I have not touched the logic/code from the OAuth authentication in my connector since the first version, so, I’m wondering if this is a bug from my side (as a I mentioned, this connector has been being used from more than 2 years without problems), maybe some changes in how Power Query SDK or the interpreter in the Power BI ecosystem?

Does anyone else experience issues like this?



In Power BI Service: 

ECorona_3-1754672256878.png

 

In Power BI Service we are facing a similar issue, after I publish a report and set the scheduled fresh (creating a new connection to my gateway), everything works fine, I can refresh at that moment, but I schedule the refresh for a time after 1 or more hours after the connection was created it fails. 

For this case the worksarounds are: I need to sign agin in the connections section or click the "Skip test connection" checkbox when the connection is being made. 

Just like the case with Desktop, this used to work without problems until few days ago. 

Extra info: We made the test using several versions of Power BI Desktop, the gateway and our connector (from a year ago until the latest available) and the issue is replicable.

10 REPLIES 10
v-nmadadi-msft
Community Support
Community Support

Hi @ECorona ,
Could you please confirm if the issue has been resolved after raising a support case? If a solution has been found, it would be greatly appreciated if you could share your insights with the community. This would be helpful for other members who may encounter similar issues.

Thank you for your understanding and assistance.

v-nmadadi-msft
Community Support
Community Support

Hi @ECorona 

As we haven’t heard back from you, we wanted to kindly follow up to check if the suggestions  provided by the community members for the issue worked. Please feel free to contact us if you have any further questions.

 

Thanks and regards

guillermoSoto
Frequent Visitor

Hello @v-nmadadi-msft ,

I am experiencing the same issue. I was wondering if you have any short- or medium-term plans to fix the Power BI service refresh?


Best regards

Hi @guillermoSoto ,
To help the community assist you more effectively, please create a new thread in the forum and include additional details about the issue you’re encountering. This will allow members to better understand your scenario and provide targeted troubleshooting guidance.
Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @ECorona 

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @ECorona 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

I'm still facing the same issue, this is my output after the attemp of scheduled refresh: 

ECorona_0-1756682651590.png

 

Hi @ECorona ,

Sorry to know it didn’t help. Please consider reaching out to Microsoft Support. You can provide them with all the troubleshooting steps you've already taken, which will help them understand the issue better and provide a resolution. They might be able to identify something specific about your admin account setup or provide a solution that isn't immediately obvious. 

Below is the link to create Microsoft Support ticket:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn

Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @ECorona 
Thanks for reaching out to the Microsoft fabric community forum.

If you implement your own OAuth flow for Microsoft Entra ID, users who have enabled Conditional Access for their tenant might encounter issues when refreshing using the Power BI service. This won't impact gateway-based refresh, but would impact a certified connector that supports refresh from the Power BI service. Users might run into a problem stemming from the connector using a public client application when configuring web-based credentials through the Power BI service.

Source: Handling authentication for Power Query connectors - Power Query | Microsoft Learn


I hope this information helps. Please do let us know if you have any further queries.
Thank you

iechegaray
Regular Visitor

I have the same problem, I notice that there are old threads where users are having the same issue  Custom Connector failing on refreshing data with m... - Microsoft Fabric Community and Oauth Data Refresh called multiple times on token expire scenario · microsoft/vscode-powerquery-sdk ...

It is pretty weird that the Refresh button tries to refresh the access_token once for each table since they come from the same data source

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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