Connect on premise data to PowerApps/Flow/PowerBI using 'On-premises data gateway' - Explained

Featured image

Based on the repeated requests from customers for connecting on premise data like SharePoint lists or SQL rows to Office 365 applications (PowerApps, Microsoft Flow, Logic Apps, Power BI), Microsoft has introduced on-premises data gateway. The on-premises data gateway acts as a bridge in providing a quick and secure connection between on premise data and Office 365 apps. Currently supported on premise applications are SharePoint 2016 and SQL 2016 (Both Enterprise and Express editions). Moreover, you can use a single gateway to connect multiple on premise applications to multiple Office 365 applications at the same time and it is dependent on the account with which you sign in, which can be either your work or school, or personal Microsoft account.

This blog is breaked down as two major steps as below,

  1. Deployment of On-premises data gateway
  2. Connect on premise data to Office 365 Application

Deployment of On-premises data gateway

Steps to be performed before installation

Hardware Requirements:

Hardware Requirements Value ———————– ——— CPU 8 Cores RAM 8 GB

Software Requirements:

Software Requirements Value ———————– ———————————————- .NET Framework Version - 4.5 Operating System Windows 7 / Windows Server 2008 R2, or later

Deployment of On-premises data gateway:

The deployment of on-premises data gateway is very simple, which includes gateway setup installation and gateway registration. Following are the steps involved in on-premises data gateway deployment,

Note: In each on premise machine, you can deploy only a single gateway.

NOTE: If you are trying to deploy the gateway in a domain controller, then you will receive the following error

Error

“Error generating an asymmetric key. The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.”

Workaround:

Open Services console, select On-premises data gateway service change the service account .from NT SERVICE\PBIEgwService to Local System, as highlighted in the below screenshot and restart the service.

Proceed with gateway registration: Now click Configure again to proceed with gateway registration.

Deployment of On-premises data gateway

After deploying on-premises data gateway , now it’s time to connect on premise data to Office 365 applications. We shall walk you through the steps involved in connecting on premise SharePoint 2016 and SQL 2016 to Office 365 using On-premises data gateway and accessing the on premise data via PowerApps.

Steps Involved,

Connecting SharePoint 2016 to Office 365

You can connect on premise applications to Office 365 by signing in as account used to deploy gateway to any one of the Office 365 applications like PowerApps or Microsoft Flow and add your required connections.

Note : Connection added in any one Office 365 application will be available for access to all other applications. For example, if you added on premise SQL connection by signing in to PowerApps, then you can also use that SQL connection for Microsoft Flow.

Here, I sign in to PowerApps and add connection for SharePoint 2016 as follows,

Connecting SQL 2016 to Office 365

Note:Using single on-premises data gateway you can create multiple connections to connect multiple on premise applications to Office 365 applications.

Accessing SharePoint List – Items via PowerApps

Accessing SQL Table - Records via PowerApps

FAQ

​1. How many gateways can be deployed in each on premise machine?

You can deploy only a single gateway

​2. Whether any additional configuration required for SharePoint 2016/SQL 2016 during gateway deployment?

No, there is no additional configuration required for SharePoint 2016/SQL 2016 during gateway deployment.

​3. Is it possible to deploy the gateway in a domain controller?

Yes, but you will receive the following error,

“Error generating an asymmetric key.
The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.”

To fix the above error, open Services console, select On-premises data gateway service change the service account from NT SERVICE\PBIEgwService to Local System and restart the service.

​4. Can I have more than one admin for a gateway?

Yes, when you manage a gateway, you can go to the administrator’s tab to add additional admins.

​5. Does the gateway admin need to be an admin on the machine where the gateway is installed?

No. The gateway admin is used to manage the gateway from within the service.

​6. Can I prevent users in my organization from creating a gateway?

No. This is on the roadmap, but currently Microsoft have not announced any timeframe.

​7. Can I get usage and statistics information of the gateways in my organization?

No. This is on the roadmap, but currently Microsoft have not announced any timeframe.

​8. Can I create multiple connections using a single gateway?

Yes, you can create multiple connections using a single gateway.

​9. Whether I need to deploy multiple gateways to connect SQL 2016/SharePoint 2016 to Office 365 apps?

No, only using a single gateway, you can connect SQL 2016/SharePoint 2016 to Office 365 apps (PowerApps, Microsoft Flow, Power BI, Logic Apps).

​10. Whether connection added in any one of the Office 365 apps will be available for access to all other apps?

Yes, for example, if you added on premise SQL connection by signing in to PowerApps, then you can also use that SQL connection for Microsoft Flow also.

​11. Whether any firewall settings required for connecting Office 365?

Yes, you need to configure firewall settings to allow the gateway to create an outbound connection using ports: TCP 443 (default), 5671, 5672, 9350 thru 9354. FYI - The gateway does not require inbound ports.

For more FAQs from Microsoft, refer the following links:

https://powerbi.microsoft.com/en-us/documentation/powerbi-gateway-onprem-faq/

https://powerapps.microsoft.com/en-us/tutorials/gateway-reference/