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
Anonymous
Not applicable

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

 

 

 

 

1 ACCEPTED SOLUTION


@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);

 

View solution in original post

5 REPLIES 5
Eric_Zhang
Employee
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
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


@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);

 

Anonymous
Not applicable

Hi @Eric_Zhang,

 

Yes you are right, the account which we should use to access the report should be 'Admin' on the workspace (Premium or non Premium).

Along with this, the Azure App should be a 'Native' app.

 

I was using the older namespace 'Microsoft.PowerBI.Api.V1' instead of 'Microsoft.PowerBI.Api.V2' hence any user with 'Member' access to workspace was able to view the report from website.

Anonymous
Not applicable

@Eric_Zhang,

 

I have passed the credentials of an account in above code which only has 'Member' access to two workspaces, 1. Premium workspace and 2. Non Premium workspace.

In both the scenarios the code now works well for a non Power BI user (here non Power BI user means he does not have access to both the workspaces and has not even signed signed up for Power BI via app.powerbi.com URL) and he is able to see the reports from IIS.

 

So I would like to know then what is the difference between Premium and Non Premium workspace when a non Power BI user accesses those workspace via .Net website.

 

Thanks,

Vinayak

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.