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 all,
I am trying power bi Embed and i am using rest api to generate the embed token. and getting Embed token with expiration time of 1 hr.
Is there anyway that I can extend the Power BI report embed token expiration time?
Thank you
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @Anonymous ,
Based on my research, we can try to use the token lifetime policy and Assign policy to a service principal to configure the expiretime up to 24 hours, please refer to this document and thread:
https://community.powerbi.com/t5/Developer/Access-token-setting-expiration-times/td-p/215696
you can also keep the default expire time and generate a new token before expire to update. when generate an embedded token, it will return the expire time, then you can generate a new token before the expire time, please refer to the example code with javascript
https://github.com/microsoft/PowerBI-JavaScript/wiki/Update-Embed-Token
https://github.com/microsoft/PowerBI-JavaScript/wiki/Refresh-token-using-JavaScript-SDK-example
we did not find sample code by RESTful, but the logic should be similar.
Update:
following policy make the expire time up to 2 hours (token refreshed when 04:55 UTC+0)
$policy = New-AzureADPolicy -Definition @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"02:00:00","MaxAgeSessionSingleFactor":"02:00:00"}}') -DisplayName "ApiDefaultPolicyScenario" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"
Best regards,
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 |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |