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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MennoTwill
Frequent Visitor

Data source credentials use old token

Hi all,

 

I searched for a while on the internet, but still couldn't find a solution.

 

I'm connect to our own REST api to get data into Power BI. The token is given in the URL as follows (example):

https://proxy.companyname.com/report/data?token=[Token here].

Currently this token expires every 10 days, so I replace it after 9 days with a new one. Not the optimal process, but it is good for now until we move to a real data warehouse with cubes. I publish the dashboard and authorize on app.powerbi.com the data source. No problem so far.

 

After that, I put the auto refresh on 8 times a day (1 hour at least in between). Works fine, until I replace the token. I do this in Advanced Editor and just change the token in url. Refresh works fine, publish gives the new data at app.powerbi.com.

 

Challenge: After the new token is published the auto refresh stops working. When I check the url I authorize the old token is still in there and not replaced by the new source? How is this possible and how can I solve that also on data source credentials the new data source is really used.

 

Thanks in advance for helping me on this!

 

Kind regards

Menno

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @MennoTwill,

 

In fact, power bi rest api contains get token api to get new access token.

I'd like to suggest you add custom steps to invoke 'get token' function and stored token string before main function, then use above token string in your function to work through expired issue.

 

Reference link:

GenerateToken

 

Regards,

Xiaoxin Sheng

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

Thank you so much for the reply Xiaoxin.

It is not the REST API token we are using. It is our own server, without any generate token possibility (yet).

I talked with colleagues and they suggested to move the token into a parameter and use that parameter in the advanced editor mode, such that you authorize on url level without the token in it. It works again in Power BI Desktop, but after publish the old token is still there.

 

To get rid off the data source, I completely removed it and published the dashboard with all errors. After that I added the source again with the parameter, but still the old token is shown on authorization..

HI @MennoTwill,

 

Can you share some formula sample about invoke api? How did your token generated?

 

BTW, I also suggest you add a custom function in your service to return avaliabed token string. It will be help to prevent similar expired issue.

 

Regards,

Xiaoxin Sheng

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

Anyone any clue what it can be?

MennoTwill
Frequent Visitor

To give additional information on this. I also tried to copy the pbix and published under a complete new name. The old token value is still as a data source in app.powerbi.com. I expect it should be something in the file which I'm not aware of.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors