Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Different UPN when embedding with powerbi.load vs powerbi.embed

Hello,

 

We've started having an issue today with our embedded PowerBI reports. We tracked down the source of the issue to a new difference in behavior between powerbi.load and powerbi.embed.

 

When calling powerbi.load, the report appears to be running in the scope of the MasterUser that the embed token was generated with (calling USERPRINCIPALNAME() gives MasterUser). However, when we call powerbi.embed, the report is ran in the scope of the user the token was generated for.

 

We can't switch our embed code over to using powerbi.embed, as it prevents the usage of callback functions/events (loaded, clicked, etc).

 

It seems that this issue started today sometime. Is anybody else having this issue?

 

Thanks,

~Andrew

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

    Did you mean the embed content uses the user that generates embed token to authorization instead of 'master users' credentials?

    If that is the case, have you saving multiple user credentials on your devices? If that is the case, I'd like to suggest your test with private mode or remove these cached data before the test.

    BTW, you can also try to use service principal mode to do embed operation, it should be better than master user mode.

    Embed Power BI content in an embedded analytics application with service principal and an application secret - Power BI | Microsoft Docs
    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! Authenticating with a service principal did resolve the issue when using .load(). I'll accept this as the solution.

       

      Is service principal mode the preferred/recommended to authenticate for embedding operations?

       

      Regards,

      ~Andrew