Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Display Power BI reports in website for non Power BI users

Hi All,

 

I have been exploring the new feature using article at samples wherein the non Power BI users can now access the Power BI reports if they have access to the .Net website which acts as a host.

 

Please see below code snippet I have used,

 

private Task Authorize()
        {
            return Task.Run(async () =>
            {
                AuthenticationContext authenticationContext = new AuthenticationContext(AuthorityUrl);
                UserCredential userCredentials = new UserCredential(); 
                var result = await authenticationContext.AcquireTokenAsync(ResourceUrl, "clientId", userCredentials);
                string newToken = result.AccessToken.ToString();
            });
        }

 

 

The above code runs fine when I launch the application from Visual Studio and I am able to view the reports.

 

However when I publish to an IIS site, the website does not show the report and logs the below error to console.

 

Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: unknown_user_type: Unknown User Type

Could someone help me in identifying and resolving the problem.

 

Thanks in advance,

 

Vinayak

 

 

 

 


  • Anonymous wrote:

    Hi Eric_Zhang,

     

    I am using IIS 10.0.10586.0 on Windows 10 OS. I will put a post to IIS forums as suggested by you to see if they can help.

     

    We have Power BI premium license in my organisation and the workspace from which I am fetching reports also is Premium workspace.

     

    When you say "By the way, what account do you use, the "embedding for non Power BI Users" would require a premium license."

    do you mean that we need to pass the service account credentials that created the workspace? Or if any other specific account is needed?

     

    Thanks,

    Vinayak


    Anonymous

    What account is used in below line. This account must be an admin of the app workspace that is being used for embedding.

    var credential = new UserPasswordCredential(Username, Password);

     

5 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft Employee

    Anonymous

    That demo works fine in my VS and IIS, I don't reproduce the issue. Most Probabbly that is an IIS issue. For better response, I'd suggest you post at the dedicated IIS forum.

     

    By the way, what account do you use, the "embedding for non Power BI Users" would require a premium license.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Eric_Zhang,

       

      I am using IIS 10.0.10586.0 on Windows 10 OS. I will put a post to IIS forums as suggested by you to see if they can help.

       

      We have Power BI premium license in my organisation and the workspace from which I am fetching reports also is Premium workspace.

       

      When you say "By the way, what account do you use, the "embedding for non Power BI Users" would require a premium license."

      do you mean that we need to pass the service account credentials that created the workspace? Or if any other specific account is needed?

       

      Thanks,

      Vinayak

      • Eric_Zhang's avatar
        Eric_Zhang
        Icon for Microsoft Employee rankMicrosoft Employee

        Anonymous wrote:

        Hi Eric_Zhang,

         

        I am using IIS 10.0.10586.0 on Windows 10 OS. I will put a post to IIS forums as suggested by you to see if they can help.

         

        We have Power BI premium license in my organisation and the workspace from which I am fetching reports also is Premium workspace.

         

        When you say "By the way, what account do you use, the "embedding for non Power BI Users" would require a premium license."

        do you mean that we need to pass the service account credentials that created the workspace? Or if any other specific account is needed?

         

        Thanks,

        Vinayak


        Anonymous

        What account is used in below line. This account must be an admin of the app workspace that is being used for embedding.

        var credential = new UserPasswordCredential(Username, Password);