Power BI Gateway - PersonalPower BI Gateway - Personal

备注

提供适用于 Power BI 的个人网关新版本,称为“本地数据网关(个人模式)”。There is a new version of the personal gateway for Power BI called the on-premises data gateway (personal mode). 下面的文章介绍了以前版本的个人网关(称为 Power BI Gateway-Personal),它将在 2017 年 7 月 31 日之后停用并停止工作。The following article describes the previous version of the personal gateway, called Power BI Gateway - Personal, which will be retired and stop working after July 31, 2017. 有关新版本的个人网关的信息(包括如何安装新版本),请参阅本地数据网关(个人模式)文章For information about the new version of the personal gateway, including how to install the new version, see the On-premises data gateway (personal mode) article.

Power BI 个人网关的作用类似于桥梁,用于在 Power BI 服务和支持刷新的本地数据源之间提供快速且安全的数据传输。The Power BI Gateway - Personal acts as a bridge, providing quick and secure data transfer between the Power BI service and on-premises data sources that support refresh. 本文旨在让你深入了解网关的工作原理以及你是否需要网关。This article is meant to provide you with an in-depth understanding of how the gateway works and whether or not a gateway is necessary for you. 我们还整理了有关个人网关的有用视频We've also put together this helpful video about the personal gateway.

它在你的计算机上作为服务安装和运行。It installs and runs as a service on your computer. 作为一种服务,它使用在配置期间指定的 Windows 帐户运行。As a service, it runs using a Windows account you specify during configuration. 在某些情况下,网关作为应用程序运行。In some cases, the Gateway runs as an application. 稍后我们将详细了解有关内容。We'll go into more about that later.

当 Power BI 刷新本地数据源的数据时,网关可确保你的 Power BI 帐户具有相应的权限来连接此数据源,并查询其中的数据。When Power BI refreshes data from an on-premises data source, the gateway assures your Power BI account has the right permissions to connect to and query data from the source.

Azure 服务总线可保护 Power BI 和网关之间的数据传输。Data transfer between Power BI and the gateway is secured through Azure Service Bus. 服务总线在 Power BI 服务和你的计算机之间创建一个安全的通道。The Service Bus creates a secure channel between the Power BI service and your computer. 由于网关提供了这种安全连接,因此通常无需在防火墙中打开一个端口。Because the gateway provides this secure connection, there’s usually no need to open a port in your firewall.

在了解有关网关的详细信息之前,让我们先了解一下 Power BI 中使用的一些术语:Before we go into details about the gateway, let’s look at some terms used in Power BI:

数据集是指从在线或本地数据源上载到 Power BI 服务的数据。A dataset is data uploaded into the Power BI service from an online or on-premises data source. 当使用“获取数据”功能连接并上载数据时将创建数据集。You create a dataset when you use Get Data to connect to and upload data. 在浏览器中的 Power BI 工作区的“我的工作区”窗格中显示数据集。Datasets appear in the My Workspace pane of your Power BI Workspace in your browser. 当你创建报表并将磁贴固定到仪表板时,你可以查看数据集中的数据。When you create reports and pin tiles to your dashboards, you’re looking at data from your datasets.

数据源是指上载到数据集中的数据的实际来源。A data source is where the data you upload into a dataset really comes from. 它可以是任何来源:数据库、Excel 工作表、Web 服务,等等。使用 Excel 工作簿,可以创建一个简单的包含多行数据的工作表,此工作表可视为一种数据源。It can be just about anything; a database, Excel worksheet, Web service, etc. With Excel workbooks, you can create a simple worksheet with rows of data, and that is considered a data source. 你还可以使用 Excel 中的 Power Query 或 Power Pivot 连接并查询在线和本地数据源中的数据,所有操作都在同一个工作簿中完成。You can also use Power Query or Power Pivot in Excel to connect to and query data from both online and on-premises data sources, all in the same workbook. 借助 Power BI Desktop,可使用“获取数据”功能连接并查询在线和本地数据源中的数据。With Power BI Desktop, you use Get Data to connect to and query data from both online and on-premises data sources.

通过本地数据网关安装个人网关。The personal gateway is installed through the on-premises data gateway. 可在 Power BI 网关页进行下载。You can download it on the Power BI Gateway page.

是否需要一个网关?Do I need a gateway?

在安装网关之前,请务必了解是否真的需要它。Before you install a gateway, it's important to know whether or not you really need one. 这实际上取决于你的数据源:It really depends on your data sources:

本地数据源On-premises data sources

若要刷新从组织中支持的本地数据源获取数据的数据集,则必须使用个人网关。A personal gateway is required in order to refresh datasets that get data from a supported on-premises data source in your organization.

在使用网关时,支持对上载自以下数据源的数据集使用“立即刷新”和“计划刷新”功能:With a gateway, REFRESH NOW and SCHEDULE REFRESH are supported for datasets uploaded from:

  • Microsoft Excel 2013(或更高版本)的工作簿,使用 Power Query 或 Power Pivot 连接并查询支持的本地数据源中的数据。Microsoft Excel 2013 (or later) workbooks where Power Query or Power Pivot is used to connect to and query data from a supported on-premises data source. Power Query 或 Power Pivot 中的“获取外部数据”中显示的所有本地数据源都支持刷新,Hadoop 文件 (HDFS) 和 Microsoft Exchange 除外。All on-premises data sources shown in Get External Data in Power Query or Power Pivot support refresh except for Hadoop file (HDFS) and Microsoft Exchange.
  • Microsoft Power BI Desktop 文件,使用“获取数据”功能连接并查询支持的本地数据源中的数据。Microsoft Power BI Desktop files where Get Data is used to connect to and query data from a supported on-premises data source. “获取数据”中显示的所有本地数据源都支持刷新,Hadoop 文件 (HDFS) 和 Microsoft Exchange 除外。All on-premises data sources shown in Get Data support refresh except for Hadoop file (HDFS) and Microsoft Exchange.

在线数据源Online data sources

当你在使用 Web.Page 功能时才会需要网关。A gateway is only required if you are using the Web.Page function. 在其他情况下,若要刷新仅从在线数据源获取数据的数据集,则无需使用网关。In other cases, a gateway is not required in order to refresh datasets that get data only from an online data source.

备注

使用 Web.Page 功能时,如果已重新发布 2016 年 11 月 18 日之后的数据集或报表,则仅需要网关。If you are using the Web.Page function, you only need a gateway if you have republished the dataset or your report after November 18th, 2016.

在不使用网关的情况下,支持对上载自以下数据源的数据集使用“立即刷新”和“计划刷新”功能:REFRESH NOW and SCHEDULE REFRESH are supported without a gateway for datasets uploaded from:

  • 来自在线数据源的内容包(内容包\服务)。Content packs from online data sources (content packs\services). 默认情况下,来自内容包的数据集每天自动更新一次,但是你也可以手动刷新或设置刷新计划。By default, datasets from content packs are automatically updated once a day, but you can also refresh manually or setup a refresh schedule.
  • Microsoft Excel 2013(或更高版本)的工作簿,使用 Power Query 或 Power Pivot 连接并查询在线数据源中的数据。Microsoft Excel 2013 (or later) workbooks where Power Query or Power Pivot is used to connect to and query data from an online data source.
  • Microsoft Power BI Desktop 文件,使用“获取数据”功能连接并查询在线数据源中的数据。Microsoft Power BI Desktop files where Get Data is used to connect to and query data from an online data source.

问:如果 Excel 工作簿或 Power BI Desktop 文件同时从在线和本地数据源中获取数据,该如何选择?Question: What if my Excel workbook or Power BI Desktop file gets data from both online and on-premises data sources?

答:需要使用网关。Answer: A gateway is required. 你需要安装并配置网关,以便刷新来自本地数据源的数据。You will need to install and configure a gateway in order to refresh data from your on-premises data sources.

问:如果 Excel 工作簿中只有我键入的行数据,该如何选择?Question:** What if my Excel workbook just has rows of data I typed in?**

答:不需要使用网关。Answer: A gateway is not required. 仅当工作簿使用 Power Query 或 Power Pivot 查询支持的本地数据源中的数据并将数据加载到数据模型时,才需要安装和配置网关You only need to install and configure a gateway if your workbook uses Power Query or Power Pivot to query and load data to the data model from a supported on-premises data source

首次设置网关Setting up a gateway for the first time

首次设置网关的流程分为三个步骤:Setting up a gateway for the first time is a three step process:

  1. 下载并安装网关Download and install a gateway
  2. 配置网关Configure the gateway
  3. 登录到 Power BI 中的数据源Sign in to data sources in Power BI

让我们仔细了解一下每一个步骤。Let’s take a closer look at each step.

下载并安装网关Download and install a gateway

备注

提供适用于 Power BI 的个人网关新版本,称为“本地数据网关(个人模式)”。There is a new version of the personal gateway for Power BI, called the on-premises data gateway (personal mode). 本文介绍了以前版本的个人网关(称为 Power BI Gateway - Personal),它将在 2017 年 7 月 31 日之后停用并停止工作。This article describes the previous version of the personal gateway, called Power BI Gateway - Personal, which will be retired and stop working after July 31, 2017. 有关新版本的个人网关的信息(包括如何安装新版本),请参阅本地数据网关(个人模式)文章For information about the new version of the personal gateway, including how to install the new version, see the On-premises data gateway (personal mode) article.

当你首次针对支持的数据集单击“立即刷新”或“计划刷新”时,系统将提示你安装网关。You’ll be prompted to install a gateway when you click on REFRESH NOW or SCHEDULE REFRESH for a supported dataset for the first time. 或者,若要下载网关,请选择“下载”菜单下的数据网关Or, to download the gateway, select Data Gateway under the Downloads menu. 下载本地数据网关Download the on-premises data gateway.

你可以选择个人网关而不是 本地数据网关以便拥有自己的网关。You will want to select Personal Gateway instead of On-premises data gateway to have a gateway that is for yourself.

实际上安装网关并没有太多步骤。There’s really not much to installing a gateway. 和安装任何其他应用程序一样,你将选择要安装到的位置,阅读并接受许可协议。You’ll select a location to install to, and read and accept the license agreement just like any other application. 但是需要了解一些重要事项。There are however some important things to know. 尤其是你要安装网关的计算机类型和你在该计算机上登录 Windows 所使用的帐户类型。In particular, the type of computer you install the gateway on and the type of account you’re logged in to Windows with on that computer.

备注

网关需要具有数据源访问权限。The gateway needs to have access to the data source. 如果你的个人计算机无法连接到数据源,可能要考虑在有权访问该数据源的计算机上安装本地数据网关If your personal machine cannot connect to the data source, you may want to consider installing an on-premises data gateway on a machine that does have access to the data source. 一个示例是在托管于 Azure 中的虚拟机 (VM) 上安装了 SQL Server。An example of this would be SQL Server installed on an virtual machine (VM) hosted in Azure. 个人计算机可能无权访问该 VM。You personal machine may not have access to the VM. 可改为在该 VM 上安装本地数据网关,并在 Power BI 服务内配置数据源。You could install the on-premises data gateway on the VM instead, and configure the a data source within the Power BI service.

计算机类型Computer type

你要安装网关的计算机类型很重要。The type of computer you install the gateway on is important.

备注

只有 64 位 Windows 操作系统才支持个人网关。The personal gateway is supported only on 64-bit Windows operating systems.

在笔记本电脑上 - 为了进行计划刷新,需要启动并运行网关。On a laptop computer - In order for a scheduled refresh to occur, the gateway needs to be up and running. 笔记本电脑通常处于关机或睡眠状态的时间多于运行状态。Laptop computers are usually shut down or asleep more than they’re running. 如果在笔记本电脑上安装网关,请务必对笔记本将要运行的时间设置计划的刷新时间。If you install your gateway on a laptop, be sure to set your scheduled refresh times for when the laptop will be running. 如果没有,那么在下次计划的刷新时间到来之前将不再尝试刷新。If it isn’t, the refresh will not be attempted again until the next scheduled refresh time.

在台式计算机上 - 没有太多的问题。On a desktop computer – Not many issues here. 只需确保计算机和网关在计划的刷新时间内是运行的。Just make sure the computer and the gateway is running at your scheduled refresh times. 许多台式计算机会进入睡眠状态,如果处于睡眠状态则无法进行计划刷新。Many desktop computers go to sleep, scheduled refresh cannot occur if it’s asleep.

一旦安装了一个网关,则无需安装另一个。Once you install a gateway, you won’t have to install another. 一个网关可用于任意数量的支持的数据集。One gateway will work for any number of supported datasets. 你无需在从中上载工作簿和 Power BI Desktop 文件的同一台计算机上安装网关。You also don’t have to install the gateway on the same computer you upload your workbook and Power BI Desktop files from. 下面是一个示例:假设你有一个连接到组织中 SQL Server 数据源的 Excel 工作簿。Here’s an example: Let’s say you have an Excel workbook that connects to a SQL Server data source in your organization. 你使用 Power BI 中的“获取数据”功能从笔记本电脑上上载此工作簿。You used Get Data in Power BI to upload the workbook from your laptop computer. 同时你有一个台式计算机始终保持运行状态,并且你在该计算机上安装和配置了网关。You also have a desktop computer you leave running all the time, and you’ve installed and configured a gateway on that computer. 在 Power BI 中,你已登录到数据源,并为数据集设置了刷新计划。In Power BI, you’ve signed in to your data sources, and you’ve setup a refresh schedule for the dataset. 当计划的刷新时间到来时,Power BI 会与台式计算机上安装的网关建立安全连接。When a scheduled refresh time comes, Power BI makes a secure connection to the gateway installed on your desktop computer. 然后网关安全地连接到数据源以获得更新。It then securely connects to the data sources to get updates. 对于刷新,不存在与从笔记本电脑上上载的原始工作簿的任何数据交换。For refresh, there’s no communication with the original workbook you uploaded from your laptop computer.

备注

可以在同一台计算机上安装个人和企业网关。You can install the personal and enterprise gateways on the same computer.

Windows 帐户Windows account

安装网关时,将使用你的 Windows 帐户登录计算机。When you install the gateway, you’ll be logged in to your computer using your Windows account. 你的 Windows 帐户所具有的权限类型将影响网关的安装方式和网关在 Windows 中的运行方式。The type of permissions your Windows account has will have an effect on how the gateway is installed and how it is run in Windows.

当你登录到 Windows:When you’re logged into Windows:

具有管理员权限With Administrator permissions 没有管理员权限Without Administrator permissions
Power BI Gateway - Personal 的运行方式Power BI Gateway - Personal runs as a 服务Service 应用程序Application
计划的刷新Scheduled Refresh 只要计算机和网关服务正在运行,你无需在计划的刷新时间登录。As long as your computer and the gateway service is running, you do not have to be logged in at the scheduled refresh time. 必须在计划的刷新时间登录到你的计算机。You must be logged in to your computer at the scheduled refresh time.
更改 Windows 帐户密码Change Windows account password 必须更改网关服务的密码。You must change your Password in the gateway service. 如果网关所使用的帐户密码不再有效,则刷新将失败。If the account password used by the gateway is no longer valid, refresh will fail. 网关将始终使用你当前登录时所用的帐户和密码运行。The gateway will always run using the account and password you are currently logged in with. 如果你没有登录到 Windows,则网关将不运行,并且刷新将失败。If you aren’t logged in to Windows, the gateway will not be running and refresh will fail.

配置网关Configure the gateway

安装向导完成后,将提示你启动配置向导。When the Installation Wizard finishes, you’ll be prompted to launch the Configuration Wizard. 实际上配置网关并没有太多步骤。There’s really not much to configuring a gateway. 你需要在向导中登录到 Power BI。You’ll need to sign in to Power BI from the Wizard. 这对于向导与 Power BI 服务中的 Power BI 帐户建立连接是必需的。This is necessary for the Wizard to establish a connection with your Power BI account in the Power BI service.

如果使用具有管理员权限的帐户登录 Windows,那么将要求你输入 Windows 帐户凭据。If you’re logged in to Windows with an account with Administrator permissions, you’ll be asked to enter your Windows account credentials. 可以指定其他 Windows 帐户,但应记住权限决定网关的运行方式。You can specify a different Windows account, but remember the permissions determine how the gateway is run. 网关服务将使用此帐户运行。The gateway service will run using this account.

登录数据源Sign in to data sources

配置向导完成后,网关已启动且正在运行,此时必须指定身份验证类型并登录数据集的每个数据源。Once the Configuration Wizard finishes and your gateway is up and running, you’ll have to specify an Authentication type and sign in to each of your dataset’s data sources. 将在 Power BI 中完成此步骤。You'll complete this step in Power BI.

你只需指定身份验证类型,并一次登录到数据源。You only need to specify an authentication type and sign in to a data source once. 你将从数据集的“设置”屏幕中的管理数据源部分登录。You sign in from the Manage Data Sources section in a dataset’s Settings screen. 如果有多个数据源,则必须登录每个数据源。If you have multiple data sources, you’ll have to sign in to each one. 网关根据数据源确定默认的身份验证类型。The gateway determines a default Authentication type depending on the data source. 在大多数情况下,使用的是 Windows 身份验证;但是在某些情况下,数据源可能要求使用其他身份验证类型。In most cases, it’s Windows authentication; however, in some cases, your data source might require a different authentication type. 如果你不确定,请与你的数据源管理员联系。If you’re unsure, check with your data source administrator.

启动并运行!Up and running!

网关启动并运行之后,可以单击数据集的“计划刷新”,你将从中看到数据集的设置页面。When your gateway is up and running, you can click SCHEDULE REFRESH for a dataset where you’ll see your dataset’s Settings page.

此页显示:This page shows:

  1. 刷新状态 – 显示刷新成功和下一次计划的刷新时间。Refresh status – Shows refresh success and next scheduled refresh time.
  2. 网关 - 显示网关是否已安装且在线。Gateway - Shows whether or not a gateway is installed and online. 如果网关已安装但不在线,则将禁用“管理数据源”和“计划刷新”设置。If a gateway is installed but not online, Manage Data Sources and Schedule Refresh settings are disabled.
  3. 管理数据源 - 显示数据集连接到的数据源。Manage Data Sources - Shows data sources the dataset connects to. 你可以登录或更改身份验证类型。You can Sign in or change the authentication type. 你只需要登录每个数据源一次。You’ll only need to Sign in to each data source once.
  4. 计划刷新 – 你可以在此处配置刷新计划设置。Schedule Refresh – You can configure a refresh schedule settings here. 如果网关不在线,则将禁用这些设置。If the gateway isn’t online, these settings will be disabled.
  5. 刷新失败通知 – 默认情况下已选中该选项,如果计划的刷新失败,将向你发送一封电子邮件。Refresh failure notifications – This option, selected by default, will send an e-mail to you if a scheduled refresh fails.

更新 Windows 帐户密码Updating your Windows account password

当你安装网关时如果使用具有管理员权限的 Windows 帐户登录计算机,那么网关将使用在配置向导中指定的 Windows 帐户作为服务运行。If you were logged into your computer with a Windows account with administrator privileges when you installed your gateway, it runs as a service using the Windows account you specified in the Configuration Wizard. 在大多数情况下,该帐户与你登录计算机所使用的 Windows 帐户相同。Most often, this will be the same Windows account you log in to your computer with. 如果更改了 Windows 帐户密码,那么也需要在网关中更改此密码,否则服务可能不运行,并且刷新将失败。When you change your Windows account password, you’ll also need to change it in the gateway, otherwise the service might not be running and refresh will fail. 若要更改网关的 Windows 帐户密码,请在 Windows 桌面任务栏或在应用中选择个人网关图标。To change your Windows account password for the gateway, select the personal gateway icon on your Windows Desktop Taskbar, or in Apps.

你可以在下图显示的页面中更新密码和检查网关的连接状态。From here, you can update your password and check your gateway's connection status.

端口Ports

网关使用以下出站端口进行通信:TCP 443(默认)、5671、5672、9350 至 9354。The gateway communicates on outbound ports: TCP 443 (default), 5671, 5672, 9350 thru 9354. 网关不需要入站端口。The gateway does not require inbound ports.

域名Domain names 出站端口Outbound ports 说明Description
*.powerbi.com*.powerbi.com 443443 HTTPSHTTPS
*.analysis.windows.net*.analysis.windows.net 443443 HTTPSHTTPS
*.login.windows.net*.login.windows.net 443443 HTTPSHTTPS
*.servicebus.windows.net*.servicebus.windows.net 5671-56725671-5672 高级消息队列协议 (AMQP)Advanced Message Queuing Protocol (AMQP)
*.servicebus.windows.net*.servicebus.windows.net 443, 9350-9354443, 9350-9354 基于 TCP 的服务总线中继侦听程序(要求使用端口 443 来获取访问控制令牌)Listeners on Service Bus Relay over TCP (requires 443 for Access Control token acquisition)
*.frontend.clouddatahub.net*.frontend.clouddatahub.net 443443 HTTPSHTTPS
*.core.windows.net*.core.windows.net 443443 HTTPSHTTPS
login.microsoftonline.comlogin.microsoftonline.com 443443 HTTPSHTTPS
login.windows.netlogin.windows.net 443443 HTTPSHTTPS

如果需要将 IP 地址而不是域列入白名单,可下载并使用 Microsoft Azure 数据中心 IP 范围列表。If you need to white list IP addresses instead of the domains, you can download and use the Microsoft Azure Datacenter IP ranges list. 下载Download

后续步骤Next steps

本地数据网关(个人模式)- 新版本的个人网关 为 Power BI Gateway 配置代理设置On-premises data gateway (personal mode) - the new version of the personal gateway Configuring proxy settings for the Power BI Gateways
Power BI PremiumPower BI Premium

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community