mas*_*mas 2 powerbi powerbi-embedded
我完成了本教程中的每个步骤,并获得了所有必需的信息/ID/参数。还看了这些视频。
但是,在运行示例 python 代码(flask 应用程序)并在浏览器中打开 localhost url 的最后阶段,我收到此错误:
Error Details:
401 Unauthorized: Error while retrieving Embed URL
Unauthorized:
RequestId: 0b143776-bc54-492e-80bc-5401ecf32fd3
Run Code Online (Sandbox Code Playgroud)
我不明白为什么
pbiembedservice.py看来我无法获取令牌,并且 401作为 api 响应返回(最后一行):
class PbiEmbedService:
def get_embed_params_for_single_report(self, workspace_id, report_id, additional_dataset_id=None):
'''Get embed params for a report and a workspace
Args:
workspace_id (str): Workspace Id
report_id (str): Report Id
additional_dataset_id (str, optional): Dataset Id different than the one bound to the report. Defaults to None.
Returns:
EmbedConfig: Embed token and Embed URL
'''
report_url = f'https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/reports/{report_id}'
api_response = requests.get(report_url, headers=self.get_request_header())
Run Code Online (Sandbox Code Playgroud)
其他帖子没有太大帮助,有人可以帮助我吗
我知道问题出在哪里了。我需要将 ADD(服务主体)中注册的应用程序添加到安全组,然后将其添加到 Power BI 管理门户 -> 租户设置 -> 开发人员点击 -> 将其添加到安全组。