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
itz4blitz
New Member

embedToken GenerateTokenAsync returning BadRequest error

I'm following the Power BI Developer In A Day course

 

I've went back over the videos and my settings several times:

I have a brand new E3 trial account.

I have imported the Sales Reports pbix into BI

I've created the appropriate "Power BI Apps" Group in Azure AD

In App Registrations I've setup "Sales Reporting" and configured the appropriate Certificate & Secret.

In PowerBI Admin; I've set the proper permissions under Developer Options

The AzureAD and PowerBi lines in my appsettings.json are configured with the correct Instance, Domain, TenantId, ClientId, ClientSecret, and WorkspaceId.

When the code calls GetReportsEmbeddingData in the provided PowerBiApiService class (included in the DevKit), I hit this error when building my MVC app and running. I've set a breakpoint and was able to see the EmbeddedReport object gets passed in with valid data.

 

itz4blitz_0-1642078670263.png

 

I was going to try catch the error but I wasn't certain how to handle or convert the exception properly.

2 REPLIES 2
Anonymous
Not applicable

Hi @itz4blitz ,

Based on the error message, it seems that there is a problem in generating and getting the token. Are you using the embed analytics solution Embed for your customers? If so, please check if you hit any of the consideration in the document below.

Considerations when generating an embed token

yingyinr_0-1642491081409.png

Considerations and limitations

In addition, please review the solution in the following links. Hope they can help you resolve the problem.

400 Bad Request Error when embedding report

Power BI Embedded with Roles, allowing Row Level Security

Best Regards

itz4blitz
New Member

In case it helps: I'm on Module 4, Video 2. I've taken all of the steps outlined in the series so far and am attempting to view the report I've embedded into the view.

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.