问题描述
我正在尝试使用以下链接在我的 MVC 应用程序中嵌入我的 Power Bi 报告 https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers 我可以获得 access_token 但是由于 401 Unauthorized 错误,无法根据 Group Id 检索仪表板或报告.
I am trying to Embedding my Power Bi Reports in my MVC application using the following link https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers and i am able to get the access_token but unable to retrieve the dashboards or reports based on Group Id because of 401 Unauthorized error.
让我知道我做错了什么.
Let me know what I am doing wrong.
推荐答案
我在 Power BI Embedded 实施过程中遇到了完全相同的问题.我的问题是 Azure Active Directory 中的注册应用程序没有授予足够的权限.请确保您已执行以下步骤:
I faced the exact same issue during my Power BI Embedded implementation. The issue in my case was that adequate Permission were not granted for the registered app in Azure Active Directory. Please ensure you have performed the following steps:
- 在 Azure Active Directory 中的应用注册下注册您的应用(本机或 Web 应用).或使用 Power BI 开发人员控制台来执行此操作 - 首选 Azure Active Directory
- 从 Permissions Option 将 Power BI API 添加到已注册的应用程序中.
- 选择并委派 Power BI API 所需的所有权限
- 最重要授予已注册应用的所有权限.如果您没有 Azure 门户的管理员访问权限,您将无法授予权限
- Register your App (Native or Web App) in Azure Active Directory under App Registrations. Or use the Power BI Developer Console to do that - Azure Active Directory Preferred
- Added the Power BI API to the registered app from Permissions Option.
- Select and Delegate all the required permissions for the Power BI API
- Most Important Grant All Permissions to the Registered App. If you don't have Admin Access to Azure Portal, you will not able able to grant the permissions
可以在此处找到更多详细信息.
More details can be found here.
这篇关于电源报告嵌入的未经授权的错误 401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!