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
jonharding
Advocate II
Advocate II

Using CustomData with Azure Analysis Services

Hello,

 

I'm embedding reports that use a live connection to Azure Analysis Services in an 'App Owns Data' scenario.  I'd like to use the CustomData feature, as described here, to do dynamic filtering on the reports.

 

I've followed the documentation, but it doesn't look like the EffectiveIdentity object has a constructor that takes the CustomData string.  Here's the code I'm currently using:

 

var generateTokenRequestParameters = new GenerateTokenRequest("view", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: username, roles: new List<string> { "TestRole" }, datasets: new List<string> { report.DatasetId }) });

var tokenResponse = client.Reports.GenerateTokenInGroupAsync(groupId, report.Id, generateTokenRequestParameters).Result;

How should I modify this to use CustomData?

 

Thanks

1 ACCEPTED SOLUTION

Hi,

This sentence in the documentation isn't updated, we will fix that.

See this section in the same doc, on how to use 'CustomData'.

View solution in original post

6 REPLIES 6
jonharding
Advocate II
Advocate II

Thanks for your replies, it's good to see the documentation will be updated.

 

I was able to get CustomData working with the latest api packages, so we can use that in conjunction with roles to do what we need to.

Hi @jonharding

 

I'm trying to do the same but when I try to generate the token I'm getting this error:

 

Creating embed token for accessing dataset XXXXXXXX requries effective identity username to be identical to the caller's principal name


So I decided to test CUSTOMDATA() functionality but I'm not sure how it works.

 

Could you please provide a sample of the roles you have created and the code you have in your app (App Owns Data) ?

Regards.

v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi,

 

I think you are hitting the limits when using the RLS in Power BI Embeded for Azure Analysis Services:

"

  • Analysis Services live connections are supported for on-premises servers.
  • Azure Analysis Services live connections support filtering by roles, but not dynamic by username.

"

Looping Staff @nimrod to confirm the current status for whether Custom Data filter is supported when it comes to RLS in Power BI embeded for Azure Analysis Services.

 

A thread for your reference.

 

Regards,

Michael

Hi,

This sentence in the documentation isn't updated, we will fix that.

See this section in the same doc, on how to use 'CustomData'.

Hello,

 

I'm embedding reports that use a live connection to Azure Analysis Services in an 'App Owns Data' scenario.  I'd like to explore the possibility of using the CustomData feature for dynamic filtering of reports as documented here.

 

The problem I have is that the EffectiveIdentity object has no overload for including CustomData as described in the documentation.  How do I pass CustomData in this case?  Here's an example of the code I'm currently using to generate the embed token:

 

var generateTokenRequestParameters = new GenerateTokenRequest("view", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: username, roles: new List<string> { "TestRole" }, datasets: new List<string> { report.DatasetId }) });

var tokenResponse = client.Reports.GenerateTokenInGroupAsync(groupId, report.Id, generateTokenRequestParameters).Result;

How should I modify this to support CustomData?

 

Thanks!

Hello,

 

I'm trying to embed all of the reports in a workspace, in an 'App Owns Data' scenario.  The reports use an on-prem SSAS model as a source, which has RLS defined in the model using roles.  My understanding from this documentation is that I should be able to pass in an EffectiveIdentity to the GenerateTokenRequest method where I specify the username, role to use and dataset id.  However, when I do this I'm getting the following error: "Creating embed token for accessing dataset xxxx-xxxx-xxxx-xxxx shouldn't have effective identity".

 

This is the code that I'm using:

var generateTokenRequestParameters = new GenerateTokenRequest("view", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: username, roles: new List<string> { "PBITest" }, datasets: new List<string> { report.DatasetId }) });

var tokenResponse = client.Reports.GenerateTokenInGroupAsync(groupId, report.Id, generateTokenRequestParameters).Result;

I'd really appreciate some help on finding where I've gone wrong...

 

Thanks!

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 community update carousel

Fabric Community Update - June 2025

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