Forum Discussion
How to define a variable for dynamic refresh token for api calls
- 3 years ago
Power BI has no memory and no concept of (mutable) variables. You need to treat each API call as if it were the first.
Hi Anonymous, instead of trying to refresh my access token, I found a really easy way to have Power BI request a new access token after my original one expired. I hope this helps!
See my post in this thread: https://community.fabric.microsoft.com/t5/Service/API-with-dynamic-access-token-can-t-refresh-in-Power-BI-service/m-p/2926281
☝️ this is simply awesome
peggysue can't thank you enough. The method works , I wasted a whole week on "AI" to find out how to refresh token as my jobs were running for an hour and getting errored out due to expired token.
You saved me from eventually being frustrated on this.
I have run several test jobs following this 1hr+, 2hr+ and it never errored out on an expired token.