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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
yp
Regular Visitor

GenerateToken REST API returns 400 if I include customData

Dear all,

I am developing a proof-of-concept Javascript app to test RLS with customdata (i.e., the app owns data scenario).

I have a model deployed on an on-premises Analysis Service server accessible through an on-premises gateway. Such a model is accessed by a PowerBI report (live connection) which is successfully published on a custom workspace (say "Workspace A") on app.powerbi.com. If I try to embed the report on the javascript app without specifying any custom data, I can succesfully get the embed token by POSTing to the ..../GenerateToken REST API, but if I try to specify any customData I get the following 400 error (redacted):

"error": {
      "code": "InvalidRequest",
      "message": "Dataset 3....e doesn't support providing CustomData in effective identity"
}

The api call is:

          `/groups/${workspaceId}/reports/${reportId}/GenerateToken`,
          {
            method: 'POST',
            data: {
              "accessLevel": "View",
              'identities': [
                {
                  username: "myusername",
                  customData: 'some string',
                  roles: ["examplerolename"],
                  datasets: ["report_dataset_id"],
                },
              ]
            }
          })

Does anyone know what I am doing wrong?

Thanks for your support!

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @yp,

 

I'm afraid the Custom Data isn't supported in your scenario. Please refer to the light blue note in this embedded-row-level-security#working-with-analysis-services-live-connections. If you want this feature, I would suggest you create an idea here.

>>>The CustomData feature will only work for models that reside in Azure Analysis Services, and it only works in live mode.

 

Best Regards,

Dale

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.