Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
So I'm currently constructing a dashboard that uses multiple OAuth endpoints. For context: I have a table of ID's and for each ID I want to check a number of endpoints what the data for that ID is. Because PowerBI doesn't support OAuth I get an refreshtoken using Postman which I feed to PowerBI and use it to get an accesstoken. My problem is the API I use has a accesstoken expiration of 10 minutes and also a limit of the amount of API calls per second causing my accesstoken to expire before the entire table is loaded.
Making things difficult is that each time I get an accesstoken, I also get back a new refreshtoken. The solution I came up with would be to store the new refreshtoken to a parameter so I can later use it to get a new accesstoken. However is it possible to do such a thing? Am I approaching this from a completely wrong angle? Or should I rewrite the entire thing to sql or python?
Thanks in advance for any help!
Solved! Go to Solution.
@nmusters wrote:
Hi,
So I'm currently constructing a dashboard that uses multiple OAuth endpoints. For context: I have a table of ID's and for each ID I want to check a number of endpoints what the data for that ID is. Because PowerBI doesn't support OAuth I get an refreshtoken using Postman which I feed to PowerBI and use it to get an accesstoken. My problem is the API I use has a accesstoken expiration of 10 minutes and also a limit of the amount of API calls per second causing my accesstoken to expire before the entire table is loaded.
Making things difficult is that each time I get an accesstoken, I also get back a new refreshtoken. The solution I came up with would be to store the new refreshtoken to a parameter so I can later use it to get a new accesstoken. However is it possible to do such a thing? Am I approaching this from a completely wrong angle? Or should I rewrite the entire thing to sql or python?
Thanks in advance for any help!
In my case, the lifetime of refreshtoken is 14 days by default and the new refreshtoken doesn't make the old expired. For Oath2 authentication, I only worked with Azure AD and the max lifetime of refreshtoken can be as long as 90 days. It is acceptable for me to manually update the pbix every 3 months.
For your case, or say for any case, in my opinion, it is not a good practice to handle duplicated authetication/REST API scenario in Power Query, I'd suggest you rewrite the entire thing in python, save the data to some file or database. Then connect to the file/db from Power BI.
@nmusters wrote:
Hi,
So I'm currently constructing a dashboard that uses multiple OAuth endpoints. For context: I have a table of ID's and for each ID I want to check a number of endpoints what the data for that ID is. Because PowerBI doesn't support OAuth I get an refreshtoken using Postman which I feed to PowerBI and use it to get an accesstoken. My problem is the API I use has a accesstoken expiration of 10 minutes and also a limit of the amount of API calls per second causing my accesstoken to expire before the entire table is loaded.
Making things difficult is that each time I get an accesstoken, I also get back a new refreshtoken. The solution I came up with would be to store the new refreshtoken to a parameter so I can later use it to get a new accesstoken. However is it possible to do such a thing? Am I approaching this from a completely wrong angle? Or should I rewrite the entire thing to sql or python?
Thanks in advance for any help!
In my case, the lifetime of refreshtoken is 14 days by default and the new refreshtoken doesn't make the old expired. For Oath2 authentication, I only worked with Azure AD and the max lifetime of refreshtoken can be as long as 90 days. It is acceptable for me to manually update the pbix every 3 months.
For your case, or say for any case, in my opinion, it is not a good practice to handle duplicated authetication/REST API scenario in Power Query, I'd suggest you rewrite the entire thing in python, save the data to some file or database. Then connect to the file/db from Power BI.
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |