Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am trying to do the Power Bi embedded using "Masteruser" from the https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/Embed%20for%20your%20... sample application.
I have granted all permissions for my App Registrations in Azure AD. But when I run the application, it returns:
Operation returned an invalid status code 'Unauthorized'
at Microsoft.PowerBI.Api.EmbedTokenOperations.GenerateTokenWithHttpMessagesAsync(GenerateTokenRequestV2 requestParameters, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.PowerBI.Api.EmbedTokenOperationsExtensions.GenerateTokenAsync(IEmbedTokenOperations operations, GenerateTokenRequestV2 requestParameters, CancellationToken cancellationToken)
at Microsoft.PowerBI.Api.EmbedTokenOperationsExtensions.GenerateToken(IEmbedTokenOperations operations, GenerateTokenRequestV2 requestParameters)
at AppOwnsData.Services.PbiEmbedService.GetEmbedToken(Guid reportId, IList`1 datasetIds, Guid targetWorkspaceId) in D:\Rassure\PBI\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 167
at AppOwnsData.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in D:\Rassure\PBI\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 75
at AppOwnsData.Controllers.EmbedInfoController.GetEmbedInfo() in D:\Rassure\PBI\Embed for your customers\AppOwnsData\Controllers\EmbedInfoController.cs:line 45
I am not sure if the error needs to be fixed from AD or Power BI side.
My appsettings.json has these settings:
{
"AzureAd": {
"AuthenticationMode": "MasterUser",
"AuthorityUri": "https://login.microsoftonline.com/organizations/",
"ClientId": "xxxxxxxxx-xxxxxx-xxxxxxxx-xxxxxxxxxxxxx",
"TenantId": "",
"Scope": [ "https://analysis.windows.net/powerbi/api/.default" ],
"PbiUsername": "xxxxx@yyyyyy.zzz",
"PbiPassword": "************",
"ClientSecret": ""
},
"PowerBI": {
"WorkspaceId": "xxxxxxxxx-yyyyy-tttt-zzzz-eeeeeeeee",
"ReportId": "xxxxxxxx-xxxxxx-47a7-xxxxxxx-xxxxxxxxxxxxx"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
What else I am missing?
regards,
Colin
Solved! Go to Solution.
Hi @ColinChin ,
According to the error message, it seems that you havn't sufficient permission to the report. Please check if you add the related master user as a member or admin to the workspace. You can find the details in the following links.
Embed Power BI Report for Customers using App Owns Data and Master User
Best Regards
Hi @ColinChin ,
According to the error message, it seems that you havn't sufficient permission to the report. Please check if you add the related master user as a member or admin to the workspace. You can find the details in the following links.
Embed Power BI Report for Customers using App Owns Data and Master User
Best Regards
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
5 | |
4 | |
4 |