Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
We are implementing Power BI Embedded using Service Principal in App Owns Data mode.
We are also implementing RLS to restrict the access from end users to the data.
Both of these 2 features working fine.
In addition, we are trying to use RLS in combination of USERNAME() and CUSTOMDATA() so that to further restrict users’ access programmatically.
We managed to make RLS + USERNAME() working without much trouble. However, we couldn’t make CUSTOMDATA() working with RLS after trying everything.
At the application side, we use GenerateToken REST API to generate access token as the following,
POST https://api.powerbi.com/v1.0/myorg/groups/{workspace-Id}/reports/{report-Id}/GenerateToken
{
"accessLevel": "View",
"identities": [
{
"username": "SOME-USERNAME",
"customData": "SOME-CUSTOMDATA",
"roles": ["SOME-ROLE"],
"datasets": ["SOME-DATASET"]
}
]
}
At the Power BI side, we use Card visual to capture and display UserName and CustomData using USERNAME() and CUSTOMDATA() built in functions. The report shows only the UserName value but not the CustomData.
We don’t see any error anywhere, but in the Power BI Embedded report, only USERNAME can be captured but not CUSTOMDATA.
Any suggestion will be appreciated.
Hi @mingluacerorg,
How did these customdata configure on your database side? Can you please share some more detail about these?
How to Get Your Question Answered Quickly
In addition, you can also take a look at the following document customdata setting parts if helps:
Regards,
Xiaoxin Sheng
Hi Xiaoxin,
Thanks for your quick response.
We had gone through the document you referenced in an early stage of our project, but it didn't resolve the issue. According to our Power BI engineer, that document is more about Azure Analysis Services while our issue is that it is not working with Power BI workspaces.
Also, could you please be more specific about what database settings should be involved? We were trying to isolate the issue by merely displaying the value of CUSTOMDATA() passed in by the application, but never succeeded. Please kindly suggest if any settings at Power BI side we should look into.
Much appreciated