Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |