Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Coder007
New Member

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 1
Anonymous
Not applicable

Hi @Coder007 ,

 

The error stack you provided points towards the token generation process. Make sure that the object is correctly configured, especially the and . Incorrect or missing IDs can lead to a "BadRequest" error. 

Ensure that your embedding token is still valid and has not expired. You may need to refresh or regenerate it if necessary.

 

You can use activity logs to track user activity in Power BI.  Please refer:

Track user activities in Power BI - Power BI | Microsoft Learn

Troubleshoot Power BI embedded analytics application - Power BI | Microsoft Learn

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.