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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Refresh function in Power BI Desktop not executing (Custom connector OAuth 2.0 PKCE implementation)

Hi all,

 

I have created a custom Power BI Connector based off the PKCE sample provided here. The connector successfully authenticates and receives an access_token and refresh_token from the API endpoint, but when clicking any Refresh button within Power BI Desktop, the captured HTTP traffic (using Fidler Classic) indicates that the Refresh function below is not being invoked at all.

This leads to an inevitable expiry of the access_token and the user is then forced to re-login. Strangely, however, when the exact same connector is deployed to Power BI Online service (via Gateway), upon each Refresh action, the Refresh function below is correctly called before the GET data call.

 

Wondering if anyone else has experienced this?

 

Refresh = (resourceUrl, refresh_token) => TokenMethod(refresh_token, "refresh_token");

 

Thanks,

Seb

Status: Needs Info
Comments
Anonymous
Not applicable

HI  @seb1234 

Do you mean that the custom connector you set up only works on PBI Service and there is no way for it to work properly in PBI Desktop? And is there an error reported when refreshing? What version of Desktop are you currently using?

 

Best Regards,
Community Support Team _ Ailsa Tao

seb1234
Regular Visitor

@Anonymous  The custom connector works on Power BI Desktop and there is no error initially. But the access_token is expiring, therefore leading to an authentication error, as Power BI Desktop is not sending a Refresh() call (to update the access_token) each time the Refresh button is clicked.

 

On the PBI Service, the Refresh() call is correctly called when refreshing the dataset.

 

Currently using Power BI Desktop version: 2.137.1102.0 (Oct 24)

 

Thanks,

Seb

This widget could not be displayed.