Forum Discussion

Coder007's avatar
Coder007
New Member
2 years ago

Power BI Embedded - Bad Request

Hey all,


I am new to Power BI and Power BI Embedded. I started working on a web app in ASP.NET Core and using the https://www.nuget.org/packages/Microsoft.PowerBI.Api/ nuget package.

 

I started off creating a simple report in Power BI, for the data I prefilled it in the power BI app (I didn't import any data).

I was able to get this report to show up on my web app via Power BI Embedded token. No problem.

 

Now I created another semantic model by importing data from an Azure SQL Database via OneLake. I created the report and I see it fine in Power BI. But when I try to access the report via Power BI Embedded, I get a "bad request". The service principal account has access to the workspace (obviously, that is how the first simple report worked). I checked the semantic model of the data I imported from SQL and the service principal also has access.

 

Is there a log I can look at on why I am getting Bad Request via Power BI Embedded?

 

Anyone have any ideas what can be wrong here? The model also doesn't use RLS if that helps.

 

Operation returned an invalid status code 'BadRequest'

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 PowerBIPoc.Services.PbiEmbedService.GetEmbedToken(Guid reportId, IList`1 datasetIds, Guid targetWorkspaceId) in C:\Dev\Blah\PowerBIPoc\src\PowerBIPoc.Services\PbiEmbedService.cs:line 170
at PowerBIPoc.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in C:\Dev\Blah\PowerBIPoc\src\PowerBIPoc.Services\PbiEmbedService.cs:line 78
at PowerBIPoc.Web.Controllers.ReportsController.GetEmbedInfo(Guid reportId) in C:\Dev\Blah\PowerBIPoc\src\PowerBIPoc.Web\Controllers\ReportsController.cs:line 47

 

1 Reply