Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
When authorizing with a Workspace Collection, I could generate an embed token with an expiry (note the expiry argument):
public static Microsoft.PowerBI.Security.PowerBIToken CreateReportEmbedToken (string workspaceCollectionName, string workspaceId, string reportId, DateTime expiration, string username = null, System.Collections.Generic.IEnumerable<string> roles = null, string scopes = null);
It doesn't appear to be possible with Power BI Embedded:
public static System.Threading.Tasks.Task<Microsoft.PowerBI.Api.V2.Models.EmbedToken> GenerateTokenInGroupAsync (this Microsoft.PowerBI.Api.V2.IReports operations, string groupId, string reportKey, Microsoft.PowerBI.Api.V2.Models.GenerateTokenRequest requestParameters, System.Threading.CancellationToken cancellationToken = null);
Is there any way that I can create a longer-lived embed token?
Hi @Anonymous ,
First of all Workspace Collection is be deprecated.
You couldn't directly control the expiration of the embed token from your code. However you can achieve that by changing overall access token life time in Azure Active Directory.
Reference : https://stackoverflow.com/questions/50486248/power-bi-embedded-app-owns-data-changing-token-expiry