cancel
Showing results for 
Search instead for 
Did you mean: 
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
MennoTwill
Frequent Visitor

Re: Data source credentials use old token

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.

Highlighted
MennoTwill
Frequent Visitor

Re: Data source credentials use old token

Anyone any clue what it can be?

Community Support
Community Support

Re: Data source credentials use old token

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 it as the solution to help the other members find it more quickly.
MennoTwill
Frequent Visitor

Re: Data source credentials use old token

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

Community Support
Community Support

Re: Data source credentials use old token

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 it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.