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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AndrzejRusin
Regular Visitor

Power BI embedded report - USERNAME() function returns service principal id instead of username

Hi,

We have developed a .Net web application where we embed Power BI reports in the App-Owns-Data scenario, ie. with the use of service principal.

With each request to view a report the embedToken is generated depending on the report metadata, ie. it checks what datasets it is using, whether these datasets require EffectiveIdentity etc. In other words it constructs the token according to the requirements.

In case of mixed-storage reports (composite-models) which are using two or more datasets this token generation used to work fine and we were passing the username parameter in the EffectiveIdentity element to apply the RLS in the datasets, but since recently this functionality stopped working. Normally we used the USERPRINCIPALNAME or USERNAME function to retrieve the username parameter to apply the RLS in DAX, but now in case of mixed-storage reports these functions (USERPRINCIPALNAME, USERNAME and USEROBJECTID) are all returning service principal id (in guid format).

We updated the libraries of the application to use the most up-to-date ones but this gave no effect. Our conclusion is that something was changed in PowerBI Service itself.

It is worth noting that it all works fine in case of reports based on single dataset.

Has anyone run into the same issues recenlty in their embedded solutions?

Best regards,

Andrzej Rusin

4 REPLIES 4
AndrzejRusin
Regular Visitor

Hi @lbendlin 

Thank you for suggestion. We have raised a ticket already. Now we are waiting for response from support, but I was wondering if anyone else encountered such problem.

Hi,

 

There was a general issue in recent 2 weeks related to embedding reports with composite models (with DirectQuery to Power BI dataset). I don't know if the issue you encountered is from the same reason, but AFAIK that issue was resolved by Power BI so maybe you can try testing your scenario again.

Hi @AmosHersch 

Thanks for information. The issue currently still exists on our side, so I think it might have been something else.

lbendlin
Super User
Super User

That doesn't sound good. Since you have a Pro license you can consider raising a Pro ticket at https://powerbi.microsoft.com/en-us/support/pro/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.