0
votes

I am new to Power BI API and following the below link to embed a power BI report in an website that uses a .NETSDK.

embed sample for customers

I am an Azure active directory user and I have downloaded power BI using my active directory account. I followed embedding setup tool to setup an application as Native user and get the application id to be used for API calls. One of my team member designed a power BI report and published the workspace sharing with me. My AuthenticationType is MasterUser. I downloaded the sample application available in GitHub as mentioned in the above tutorial. I have been made an admin for my power BI pro account and trying to integrate the report in the website. I replaced the credentials and other ids as as described in the tutorial. But this gives me the following error-

unknown_user_type: Unknown User Type

This is the piece of code that's failing during AquireTokenAsync call.

private async Task<AuthenticationResult> DoAuthentication()
    {
        AuthenticationResult authenticationResult = null;
        if (AuthenticationType.Equals("MasterUser"))
        {
            var authenticationContext = new AuthenticationContext(AuthorityUrl);

            // Authentication using master user credentials
            var credential = new UserPasswordCredential(Username, Password);
            authenticationResult = authenticationContext.AcquireTokenAsync(ResourceUrl, ApplicationId, credential).Result;
        }

        return authenticationResult;
    }

Please help me solve this. Thanks in advance.

1
Can we see some code?Greg
I am using the sample application available at github.com/Microsoft/PowerBI-Developer-SamplesMeenakshi Dash
@Greg I have added the piece of code to my question.Meenakshi Dash

1 Answers

0
votes

As noted in this thread, you must be an admin of the workspace you are trying to embed. Using a AAD user that is only a member of the workspace for embedding will cause this error.