Power BIPower BI

重要

Power BI Desktop 2.85.681.0 和更高版本中集成的 Azure Databricks 连接器均为 公共预览版The Azure Databricks connector that is integrated in Power BI Desktop version 2.85.681.0 and above is in Public Preview.

Microsoft Power BI 是一种业务分析服务,它使用自助服务商业智能功能提供交互式可视化效果,使最终用户能够自行创建报表和仪表板,而无需依赖于信息技术人员或数据库管理员。Microsoft Power BI is a business analytics service that provides interactive visualizations with self-service business intelligence capabilities, enabling end users to create reports and dashboards by themselves without having to depend on information technology staff or database administrators.

将 Azure Databricks 用作 Power BI 的数据源时,可以将数据科学家和数据工程师以外 Azure Databricks 性能和技术的优势引入到所有业务用户。When you use Azure Databricks as a data source with Power BI, you can bring the advantages of Azure Databricks performance and technology beyond data scientists and data engineers to all business users.

你可以使用内置 Azure Databricks 连接器将 Power BI Desktop 连接到 Azure Databricks 群集。You can connect Power BI Desktop to your Azure Databricks clusters using the built-in Azure Databricks connector. 您还可以将 Power BI 报表发布到 Power BI 服务,并使用户能够使用 SSO 访问底层 Azure Databricks 数据,同时传递用于访问报表的相同 Azure AD 凭据。You can also publish your Power BI reports to the Power BI service and enable users to access the underlying Azure Databricks data using SSO, passing along the same Azure AD credentials they use to access the report.

要求Requirements

Power BI Desktop 2.85.681.0 或更高版本。Power BI Desktop 2.85.681.0 or above. 下载最新版本Download the latest version.

步骤1:获取 Azure Databricks 连接信息Step 1: Get Azure Databricks connection information

  1. 获取 个人访问令牌Get a personal access token.
  2. 获取服务器 主机名、端口和 HTTP 路径Get the server hostname, port, and HTTP path.

步骤2:在 Power BI 中配置 Azure Databricks 群集连接Step 2: Configure Azure Databricks cluster connection in Power BI

  1. 在 PowerBI Desktop 中,转到 " 获取数据" > Azure "并选择 Azure Databricks 连接器。In PowerBI Desktop, go to Get Data > Azure and select the Azure Databricks connector.

    获取数据列表中的 Databricks 连接器Databricks connector in Get Data list

  2. 单击“连接”。Click Connect .

  3. 粘贴在步骤1中检索到的 服务器主机名HTTP 路径Paste the Server Hostname and HTTP Path you retrieved in Step 1.

    Databricks JDBC/ODBC 配置Databricks JDBC/ODBC configuration

  4. 选择 数据连接模式Select your Data Connectivity mode .

    有关导入和 DirectQuery 之间的差异的信息,请参阅 在 Power BI Desktop 中使用 DirectQueryFor information about the difference between import and DirectQuery, see Use DirectQuery in Power BI Desktop.

  5. 单击“确定”。Click OK .

  6. 在 "身份验证" 提示符下,选择要登录到 Azure Databricks 的方式:At the authentication prompt, select the way you want to log in to Azure Databricks:

    Azure Active Directory :使用 Azure 帐户凭据。Azure Active Directory : Use your Azure account credentials. 单击“登录”按钮。Click the Sign in button. 在登录对话框中,输入 Azure 帐户用户名 (电子邮件、电话或 Skype) 。In the sign-in dialog, enter your Azure account username (email, phone, or Skype).

    个人访问令牌 :使用在步骤1中检索到 Azure Databricks 生成的个人访问令牌。Personal Access Token : Use your Azure Databricks-generated personal access token you retrieved in Step 1.

    备注

    用户名/密码 身份验证未启用 Azure Databricks 的访问。Username / Password authentication is not enabled for access to Azure Databricks. 建议使用 Azure Active Directory 身份验证。It is recommended that you use Azure Active Directory authentication.

  7. 单击“连接”。Click Connect .

  8. 从 Power BI 导航器中选择要查询的 Azure Databricks 数据Select the Azure Databricks data you want to query from the Power BI Navigator

    Power BI NavigatorPower BI Navigator

使用 Power BI 服务访问 Azure DatabricksAccess Azure Databricks using the Power BI service

将报表发布到 Power Bi 服务时,可以让用户使用 SSO 访问报表和基础 Azure Databricks 数据源:When you publish a report to the Power Bi service, you can enable users to access the report and underlying Azure Databricks data source using SSO:

  1. 将 Power BI 报表从 Power BI Desktop 发布到 Power BI 服务。Publish your Power BI report from Power BI Desktop to the Power BI service.

  2. 启用单一登录 (SSO) 对报表和基础数据源的访问权限。Enable single sign on (SSO) access to the report and underlying data source.

    1. 在 Power BI 服务中,前往报表的底层 Azure Databricks 数据集,展开 " 数据源凭据 ",然后单击 " 编辑凭据 "。Go to the underlying Azure Databricks dataset for the report in the Power BI service, expand Data source credentials , and click Edit credentials .
    2. 在 "配置" 对话框中,选择 " 报表查看器" 只能使用 "直接查询" Power BI 标识访问此数据源 ,并单击 " 登录 "。On the configuration dialog, select Report viewers can only access this data source with their own Power BI identities using Direct Query and click Sign in .

    启用用于 Databricks 数据访问的 SSOEnable SSO for Databricks data access

    选中此选项后,将使用 DirectQuery 处理对数据源的访问,并使用访问报表的用户的 Azure AD 标识对其进行管理。With this option selected, access to the data source is handled using DirectQuery and managed using the Azure AD identity of the user who is accessing the report. 如果未选择此选项,则只有在发布报表的用户才能访问 Azure Databricks 数据源。If you don’t select this option, only you, as the user who published the report, will have access to the Azure Databricks data source.