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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mick22
Frequent Visitor

Embed for Customer Portal - Request exceeds the maximum number of datasets - 50

I have developed a website (based on the Embed for Customers example) that based on the user that is logged in it shows them all of their power bi reports selectable by a dropdown list.  I'm using a service principal which has access to the Premium Workspaces.  We are using a Premium Capacity.  If a user has less than 50 reports, the website works fine.  When a user has more than 50 reports I'm getting the following error:

 

Error

            Status: BadRequest (400)
Response: {"error":{"code":"InvalidRequest","message":"Request exceeds the maximum number of datasets - 50"}}
RequestId: dfd60c00-f508-44e1-a55d-04561c8ae450

 

This error occurs when the last line of code executes and it tries to generate the token.   Any ideas of what I may be doing incorrect?  My understanding is there is no limitations on generating tokens in a premium capacity.

 

 

                // Create a request for getting Embed token 
                // This method works only with new Power BI V2 workspace experience
                var tokenRequest = new GenerateTokenRequestV2(

                    datasets: datasets,

                    reports: reports,

                    targetWorkspaces: targetWorkspaceIds != null ? targetWorkspaces : null
                );

                // Generate Embed token
                var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);

 

 

1 ACCEPTED SOLUTION
AmosHersch
Microsoft Employee
Microsoft Employee

Hi,

 

Embed token is indeed limited for the number of artifacts (reports/datasets/etc.) that it can allow access to, and it seems that you've hit one of the limitations.

For showing the list of reports you don't actually need the embed token. I guess you only need it when you actually want to render the selected report. Maybe generating a token after the user chooses the report from the list (only for the specific report) can be a solution?

View solution in original post

2 REPLIES 2
mick22
Frequent Visitor

Hello AmosHersch,

 

That's an interesting thought, however different than the Embed For Customers project template does it and thus the reason I hit this error.  I'm not sure how much work it would take to recode it to get the token AFTER the report is selected in the dropdown but I may look at that!  Thank you.

AmosHersch
Microsoft Employee
Microsoft Employee

Hi,

 

Embed token is indeed limited for the number of artifacts (reports/datasets/etc.) that it can allow access to, and it seems that you've hit one of the limitations.

For showing the list of reports you don't actually need the embed token. I guess you only need it when you actually want to render the selected report. Maybe generating a token after the user chooses the report from the list (only for the specific report) can be a solution?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.