【问题标题】:Embed power BI Report into an website using MVC使用 MVC 将 Power BI 报表嵌入网站
【发布时间】:2019-03-25 23:24:27
【问题描述】:

我是 Power BI API 的新手,我通过以下链接将 Power BI 报告嵌入到使用 .NETSDK 的网站中。

embed sample for customers

我是 Azure Active Directory 用户,我已使用我的 Active Directory 帐户下载了 Power BI。我按照embedding setup tool 将应用程序设置为本地用户并获取用于 API 调用的应用程序 ID。我的一位团队成员设计了一份 Power BI 报告并发布了与我共享的工作区。我的 AuthenticationType 是 MasterUser。 如上述教程中所述,我下载了 GitHub 中提供的示例应用程序。我已成为我的 power BI pro 帐户的管理员,并尝试将报告集成到网站中。我按照教程中的描述替换了凭据和其他 ID。但这给了我以下错误-

unknown_user_type:未知用户类型

这是在 AquireTokenAsync 调用期间失败的代码。

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;
    }

请帮我解决这个问题。提前致谢。

【问题讨论】:

标签: c# azure powerbi powerbi-embedded


【解决方案1】:

this thread 中所述,您必须是您尝试嵌入的工作区的管理员。使用仅是工作区成员的 AAD 用户进行嵌入会导致此错误。

【讨论】:

  • 我的帐户是管理员帐户。拥有管理员帐户和成为特定工作区的管理员之间有区别吗?我的理解是,如果我是该帐户的管理员,那么我就是所有可用或共享工作区的管理员。如果这不正确,请告诉我。
  • 在这种情况下是有区别的。在嵌入式文档中,它指出“在任何一种情况下,主帐户或服务主体都必须是与您的应用程序相关的应用程序工作区的管理员。”成为工作区管理员后,如果这不起作用,请告诉我。 docs.microsoft.com/en-us/power-bi/developer/…
  • 我确认我是我尝试访问的工作区的管理员。我仍然遇到同样的错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-11-05
  • 1970-01-01
  • 1970-01-01
  • 2018-10-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多