March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have embedded a Power BI report into my webapp using "Power BI Embedded" (following the model "embed for your customer").
All the token creation, sending them back and forth, works fine. But the token expires within 1-hr. I need to refresh the token it before it expires. Here is how to refresh the token: Refresh the access token in Power BI embedded analytics | Microsoft Docs
However the KEY to the solution is implementing the function getNewUserAccessToken() .
There is already a similar post here https://community.powerbi.com/t5/Developer/How-to-implement-getNewUserAccessToken-function-for-Power...However, the "accepted solution" in this post works becasue the token acquisition in the Power Platform.
But I'm doing token acquisition via C# code as in standard "embed for your customer" .
What should the C# code look like for function getNewUserAccessToken() in "embed for your customer"?
Help appreciated,
( cc'ing you guys in case you know something @Anonymous @v-yiruan-msft )
Hi @Chorda,
In fact, I think they should have similar logic.
You can create a similar function with 'if statement' and 'get token' API to get token and expiry date time to stored into global variables.
Then you can set a loop or timer to compare system time and expiration DateTime and invoke the generate new token function to update the stored tokens to update before the expiry date.
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
3 | |
2 | |
1 | |
1 |
User | Count |
---|---|
6 | |
3 | |
3 | |
2 | |
2 |