Forum Discussion
Anonymous
2 years agoNot applicable
Creating an embedded report with a fabric datasource using service principle authentication
I have an app that displays power bi reports from a workspace. When I use fabric as a datasource, I get an error in var tokenResponse =
await client.Reports.GenerateTokenAsy...
Anonymous
2 years agoNot applicable
using (var client = new PowerBIClient(
new Uri("https://api.powerbi.com/"), tokenCredentials))
{
var report =
await client.Reports.GetReportInGroupAsync(
new Guid(SelectedWorkspaceId),
new Guid(SelectedReportId));
var generateTokenRequestParameters =
new GenerateTokenRequest(accessLevel: TokenAccessLevel.View);
var tokenResponse =
await client.Reports.GenerateTokenAsync(
new Guid(SelectedWorkspaceId),
new Guid(SelectedReportId),
generateTokenRequestParameters);
await Interop.ShowReport(
JSRuntime,
PowerBIElement,
tokenResponse.Token,
report.EmbedUrl,
report.Id.ToString());
}
This is the code I'm using to get the token. This is what is producing the error
Anonymous
2 years agoNot applicable
HI Anonymous,
So you mean these processes get the return the error messages that you faced and motion at the above? Have you tried to create a common function to invoke these operations instead of package into the using functions?
The GC may affect the await processings, perhaps you can add some output trace to confirm these required parameters has correctly generated in your codes processings.
BTW, are you worked with fabric API? AFAIK, current it seems not support service principal.
Regards,
Xiaoxin Sheng