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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ZakariaS
New Member

Using Customdata with live connection to on-prem SSAS

Hi All,

 

I'm implementing a Power BI Embedded solution having a live connection to my on-prem SSAS. I want to define roles based on my application username. I followed this blog : https://www.kasperonbi.com/using-customdata-and-ssas-with-power-bi-embedded/

 

The solution works fine in the service, I can see using SQL Server Profiler that the customdata has been passed. But when calling the API for the embed token, I get the following error: 

Operation returned an invalid status code 'Forbidden'

I noticed while debugging that the customdata value hasn't been passed and it's always null.

 

I use the following to generate the token:

var generateTokenRequestParameters = new GenerateTokenRequest("View", identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: currentUserName, roles: new List<string> { "RoleA" }, datasets: new List<string> { "b1ff16fc-aa63-49a3-8cb6-cad785b228f7" }) });
string embedToken =
(await pbiClient.Reports.GenerateTokenInGroupAsync(workspaceId,
report.Id,
generateTokenRequestParameters)).Token;

 

Can you help me troubleshoot this issue, a quick answer would be much appreciated. 

 

Best, 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @ZakariaS 

Please refer to the following documents:

steps to begin setting up the CustomData() feature with your Power BI Embedded application.

https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security#working-with-analysi...

 
 
Best Regards
Maggie

 

 

Thank you for your answer, 

 

this is exactly what I followed. Now I'm getting another error, if I embed the report without any role it works perfectly, but once I add a role, it says "can't deploy the visual" and SQL profiler shows the following : "The cube either does not exist or has not been processed." 

 

Has anyone faced this before ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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