Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I have multiple queries requesting data over an API needing an access token to do so. There is a token request limitation for this API in place. Only five access tokens per second can be requested. One access token is valid for one hour. Enough time for all queries to request the data unsing the single requested access token.
How do I cache that access token for multiple queries enabling a scheduled refresh in PBI-Service?
I tried to encapsulate the access token request as a function but this didn't do the trick. I always get this error when refreshing the dataset online:
The PBI-Desktop version works. The query staging looks like this:
I think one problem is, that this still calls the function every time an API Request query is refreshed and not only once for all. And the other problem is that this I cannot use a query inside another query (Formula.Firewall).
Just to mention it,
Thanks for any help or hints in this regards. ✌️😁
Solved! Go to Solution.
I solved it by creating a workspace dedicated to the access token and the API data requests via dataflows.
Things to remember:
Positive about this approach is, that any credentials are saved in a separate workspace. Users with viewing rights can only see the tables with active "Enable load" option like report builders in other workspaces. Also, each individual dataflow can have its own scheduled refresh. This gives a nice structure for governance in a growing team with different roles. Everything is withing PBI-Service. And it solves the token cache problem. Only one token is requested and used.
Hi @PhilippDF ,
Please see if the document can help:
API Management Policy for Access Token Acquisition, Caching and Renewal - Microsoft Community Hub
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I solved it by creating a workspace dedicated to the access token and the API data requests via dataflows.
Things to remember:
Positive about this approach is, that any credentials are saved in a separate workspace. Users with viewing rights can only see the tables with active "Enable load" option like report builders in other workspaces. Also, each individual dataflow can have its own scheduled refresh. This gives a nice structure for governance in a growing team with different roles. Everything is withing PBI-Service. And it solves the token cache problem. Only one token is requested and used.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |