Software and Tools
Power BI Gateway Explained: Setup, Configuration & Best Practices
By Amjid Ali · · Updated · 12 min read

In this article
- Quick answer: set up a Power BI gateway in 6 steps
- What is the Power BI gateway and what is it used for?
- Power BI gateway architecture: how a query flows
- Types of Power BI gateway: standard vs personal mode vs VNet
- Requirements before you install
- Firewall and proxy: the ports the gateway needs
- Step-by-step: install and register the gateway
- Add a data source and schedule refresh in the Power BI service
- Set up a VNet data gateway (Azure data behind private endpoints)
- Gateway clusters for high availability
- Common Power BI gateway errors and fixes
- Best practices
- Learn Power BI end to end
- Related guides
A Power BI gateway, officially the on-premises data gateway, is a free Windows service you install on a server inside your network so the Power BI service can refresh and query data that lives on-premises, such as SQL Server, Oracle, SAP, Excel files on a share or a local PostgreSQL. It only opens outbound connections to Azure Relay, so you never open inbound ports. Install it in standard mode on an always-on Windows Server, register it with your work account, then add each data source under Settings > Manage connections and gateways in the Power BI service.
Quick answer: set up a Power BI gateway in 6 steps
- Pick an always-on, wired Windows Server 2019/2022/2025 machine (not a laptop and not a domain controller).
- Download the standard mode gateway from Microsoft and run the installer as a local administrator.
- Sign in with your work or school (Microsoft Entra ID) account.
- Choose Register a new gateway on this computer, give it a unique name and save the recovery key somewhere safe.
- In the gateway app, go to Diagnostics > Network ports test and make sure it reports Completed (Succeeded).
- In the Power BI service, open Settings > Manage connections and gateways > New, add the on-premises connection, then point your semantic model's scheduled refresh at it.
The rest of this guide covers each step in detail, the three gateway types, the exact firewall rules and the errors people hit most often.
What is the Power BI gateway and what is it used for?
The gateway is a bridge between your local data sources and Microsoft's cloud. Microsoft describes it as "a locally installed Windows client application" that "requires no inbound ports to your network, only outbound ports". In practice a Power BI gateway is used for:
- Scheduled refresh of imported semantic models from on-premises databases and file shares.
- DirectQuery and live connections to on-premises SQL Server, Oracle, SAP HANA or Analysis Services.
- Dataflows and paginated reports that read on-premises sources.
- Power Apps, Power Automate and Logic Apps reading and writing on-premises data.
One gateway can serve several Microsoft services at once:
- Power BI semantic models, dataflows and paginated reports
- Microsoft Fabric (Dataflow Gen2, data pipelines, Copy Job)
- Power Apps, Power Automate and Azure Logic Apps
- Azure Analysis Services and Azure Data Factory
You need a gateway whenever a published report refreshes from or runs DirectQuery against something the cloud cannot reach directly. Cloud sources such as SharePoint Online or an Azure SQL database with a public endpoint usually refresh without one.
Power BI gateway architecture: how a query flows
Microsoft's architecture article lists six steps every time a report touches on-premises data:
- The cloud service (Power BI, Fabric, Power Platform) creates a query and the encrypted credentials for the data source, and queues them for the gateway.
- The gateway cloud service analyzes the query and pushes the request to Azure Relay.
- Azure Relay hands pending requests to the gateway when the gateway polls over its outbound connection. Both sides accept only TLS 1.2 traffic.
- The gateway (a Windows service on your server) picks up the query, decrypts the credentials locally and connects to one or more data sources.
- It sends the query to the data source to run.
- Results go back to the gateway and then to the cloud service. Large refresh results are spooled to the gateway's disk until complete, which is why Microsoft recommends an SSD.
Two consequences matter for design. First, because everything is polled over outbound connections, you never publish the gateway or your database to the internet. Second, traffic from the gateway to Azure Relay normally crosses the public internet (encrypted); if policy forbids that, Microsoft notes you can use Azure ExpressRoute. Users signing in to Power BI must exist in Microsoft Entra ID, and for single sign-on or Analysis Services live connections the Entra UPN should match the on-premises Active Directory UPN (Entra Connect does this).
Limits worth knowing from Microsoft Learn: a maximum of 1,000 data sources per gateway cluster, a 16 MB uncompressed response limit for Power BI DirectQuery through the gateway, and cached credentials that can take around five hours to pick up a password change.
Types of Power BI gateway: standard vs personal mode vs VNet
You may also see the standard mode gateway called the Power BI enterprise gateway: that was its earlier name, and Microsoft's docs still refer to "enterprise or personal gateway clusters". Today there are three types:
| Standard mode | Personal mode | VNet data gateway | |
|---|---|---|---|
| Who uses it | Many users, shared | One user only | Many users, shared |
| Services | Power BI, Fabric, Power Apps, Power Automate, Logic Apps, AAS | Power BI only | Fabric Dataflow Gen2, pipelines, Copy Job, Mirroring, Power BI semantic models and paginated reports |
| Where it runs | Your Windows server | Your PC | Microsoft-managed, injected into your Azure VNet |
| DirectQuery / live connection | Yes | No (import refresh only) | Yes |
| High-availability cluster | Yes | No | Managed by Microsoft |
| Licence needed | Free software | Free software | Fabric F, Premium P or A4+ capacity |
| Best for | Most organisations | A single analyst testing | Azure data behind private endpoints / Private Link |
Microsoft's own recommendation is standard mode, ideally in a cluster. You can install one standard and one personal gateway on the same computer, but not two of the same mode. If Private Link is enabled on your tenant, use the VNet data gateway: the on-premises gateway is not supported with Private Link.
Requirements before you install
From the Microsoft Learn install guide:
| Minimum | Recommended | |
|---|---|---|
| OS | Windows 10, 11, Server 2019, 2022 or 2025 | 64-bit Windows Server 2019, 2022 or 2025 |
| .NET | .NET Framework 4.8 | .NET Framework 4.8 |
| CPU / RAM | Not stated | 8 cores, 8 GB RAM |
| Disk | 4 GB free for performance logs | SSD for spooling |
Things that catch people out:
- Not on a domain controller, not on Server Core and not in a Windows container.
- Not on a laptop or any machine that sleeps or goes offline; refreshes fail when it does.
- Use a wired connection; wireless and busy shared VMs slow refreshes down.
- For Windows authentication to a remote domain, the gateway machine must be domain-joined with a trust to that domain.
- Put the gateway close to the data (same site or same Azure region) to cut latency.
A VM is fine, but Microsoft warns that a virtualisation layer can make performance inconsistent. On a Proxmox host like the ones in my lab, give the gateway its own Windows Server VM with dedicated vCPUs and RAM rather than squeezing it onto the database server.
Firewall and proxy: the ports the gateway needs
The gateway needs no inbound ports. It makes outbound connections on TCP 80, 443, 5671, 5672 and 9350 to 9354. The main endpoints from the communication settings page are:
| Domain | Outbound port | Purpose |
|---|---|---|
*.download.microsoft.com |
443 | Installer and version checks |
*.powerbi.com, *.analysis.windows.net |
443 | Find your Power BI cluster |
login.microsoftonline.com, *.login.windows.net, login.live.com, aadcdn.msauth.net, *.microsoftonline-p.com |
443 | Microsoft Entra sign-in |
*.servicebus.windows.net |
5671-5672 | AMQP |
*.servicebus.windows.net |
443, 9350-9354 | Azure Relay over TCP |
*.msftncsi.com |
80 | Internet connectivity check |
gatewayadminportal.azure.com |
443 | Gateway management |
If you run Fabric Dataflow Gen2 or pipelines through the gateway, also allow *.dfs.fabric.microsoft.com (443), *.datawarehouse.fabric.microsoft.com (1433) and *.frontend.clouddatahub.net (443).
Only 80 and 443 allowed? Open the gateway app, go to Network and switch on HTTPS mode. New installs default to HTTPS, but upgraded older installs may still use TCP. If your proxy needs authentication, change the gateway service account from the default service SID (NT SERVICE\PBIEgwService) to a domain account.
On a pfSense firewall, scope the rule to the gateway machine only rather than the whole server VLAN. pfSense host aliases cannot hold wildcards like *.servicebus.windows.net, so for firewalls like that Microsoft publishes the Azure IP ranges and service tags (PowerBI, ServiceBus, AzureActiveDirectory, AzureCloud) as a weekly JSON file.
Step-by-step: install and register the gateway
Here is the full walkthrough on our YouTube channel:
1. Download the standard gateway
Download it from Microsoft: the standard mode installer (or the personal mode installer if you only need it for yourself). Microsoft ships a new gateway release every month and supports only the last six, so always start with the current one.
2. Run the installer
Run it as a local administrator, keep the default installation path, accept the terms and select Install.
3. Sign in
Enter your work or school email address (a Microsoft Entra ID organisation account, for example name@contoso.onmicrosoft.com) and select Sign in. Personal Microsoft accounts are not accepted.
4. Register the gateway
Select Register a new gateway on this computer > Next. Enter a name that is unique in your tenant and a recovery key. Store the recovery key in your password manager: Microsoft cannot retrieve it, and you need it to restore, move or add cluster members. Leave the region as your tenant's default region if you use it for Power BI. Select Configure.
5. Check the status and the network test
The final screen should show the gateway as online and ready for Power BI, Power Apps and Power Automate. Then open Diagnostics > Network ports test > Start new test. You want Completed (Succeeded). If it fails, open the last results file: any line marked Closed is a port your firewall is blocking.
6. Add gateway admins
In the Power BI service or the Power Platform admin center, add at least one other administrator to the gateway so it is not tied to a single person who might leave.
Add a data source and schedule refresh in the Power BI service
- In the Power BI service, select the Settings (gear) icon > Manage connections and gateways.
- Select New, choose On-premises, pick your Gateway cluster name, enter a Connection name and the Data Source Type (for example SQL Server).
- Enter the server and database. They must match exactly what you used in Power BI Desktop: if Desktop uses
SQL01\SALES, do not enter an IP address here. - Choose the authentication method (Windows, Basic or OAuth2), enter credentials, set the privacy level and select Create.
- Under Manage users, give the report authors User access to that connection (not admin access to the whole gateway).
- Open your semantic model's Settings, expand Gateway and cloud connections, map each data source to the connection, then set Scheduled refresh.
If the model uses several sources, every one of them must be mapped to a connection or the gateway option stays greyed out. Shared capacity (Pro) allows up to 8 scheduled refreshes a day; Premium Per User and Fabric/Premium capacity allow up to 48.
Set up a VNet data gateway (Azure data behind private endpoints)
If your data sits in Azure behind private endpoints, the virtual network data gateway avoids running your own Windows server. Microsoft's create guide has three steps:
- Register the resource provider. In the Azure portal, as subscription owner, open the subscription > Resource providers, find Microsoft.PowerPlatform and select Register.
- Delegate a subnet. Add a new, dedicated subnet in the VNet (not named
gatewaysubnetorAzureBastionSubnet, no IPv6) and set its delegation to Microsoft.PowerPlatform/vnetaccesslinks. Size it for 5 reserved IPs plus one per gateway member: two clusters of three members need at least 11 addresses. - Create the gateway. In the Power BI service, open Settings > Manage connections and gateways > Virtual network data gateways > New, choose the capacity, subscription, resource group, VNet and subnet, then Save.
It needs a Fabric capacity (any F SKU; Microsoft recommends F8 or above) or Power BI Premium P or A4+ capacity, runs in the region of your VNet, and supports Fabric Dataflow Gen2, pipelines, Copy Job, Mirroring, Power BI semantic models and paginated reports, but not Power BI dataflows or datamarts.
Gateway clusters for high availability
A single gateway is a single point of failure. A cluster lets you add more gateways on other machines: if the primary goes offline, queries route to the next member, and load can be spread across members.
- Install the gateway on a second server.
- When registering, tick Add to an existing gateway cluster, select the primary gateway and enter its recovery key.
- Keep all members on the same gateway version, and remove or disable members that are permanently offline; offline members hurt performance.
Each gateway has a concurrency limit of 30 refreshes. If you see "There are too many refreshes occurring concurrently", add members to the cluster or split heavy models onto a second cluster.
Common Power BI gateway errors and fixes
| Error | Likely cause | Fix |
|---|---|---|
| Your data gateway is offline or couldn't be reached | Machine off/asleep, service stopped, ports blocked | Start the "On-premises data gateway service", run the network ports test, enable HTTPS mode |
| Power BI service reported local gateway as unreachable | Validation failed at the end of setup | Restart the gateway service, then review exported logs |
| Failed to create a gateway. Try again. | Proxy configuration | Configure the proxy in the gateway config files and check proxy logs |
| Failed to add user to group (-2147463168 PBIEgwService Performance Log Users) | Installing on a domain controller | Install on a member server instead |
| Information is needed in order to combine data | Desktop set to "Always ignore privacy level settings" | Set real privacy levels in Desktop, republish, set credentials to Organizational |
| There are too many refreshes occurring concurrently | 30-query concurrency limit reached | Add cluster members or spread refresh schedules |
| Refresh fails right after changing a password | Gateway caches credentials for a few hours | Wait, or restart the gateway service |
The fastest way to debug a single data source is to install Power BI Desktop on the gateway machine and refresh the report there. If it fails in Desktop on that machine, the gateway will fail too, usually because of a missing driver (Oracle, MySQL ODBC, SAP) or file-share permissions for the service account. For logs, use Diagnostics > Export logs in the gateway app (saved as a zip in an ODGLogs folder on the desktop) or Event Viewer under Applications and Services Logs > On-premises data gateway service.
Best practices
- Update monthly. Only the last six releases are supported; upgrade one cluster member at a time.
- Use a cluster for anything production, even if the second member is a small VM.
- Least privilege. Share individual connections with users, keep gateway admin to a small group, and use a service account with read-only database rights.
- Monitor it. Turn on gateway performance monitoring and the diagnostics template to see query duration and concurrency.
- Keep it close to the data and on its own machine, not on the database server.
- Document the recovery key and the gateway name in your IT runbook.
Learn Power BI end to end
The gateway is only the plumbing; the value is in the model and the reports. If you want to build those properly, my Power BI course (56 lectures) covers the full workflow: Power Query, star-schema data modeling, DAX, visual design, publishing, gateways, refresh and security.
Related guides
- Power BI vs Tableau: choosing the right tool
- Cloud computing vs big data: key differences
- Top cloud service providers compared
All technical details above are from Microsoft Learn; see the sources below.
Frequently asked questions
What is a Power BI gateway?+
A Power BI gateway (the on-premises data gateway) is a free Windows service from Microsoft that sits inside your network and lets Power BI, Fabric, Power Apps, Power Automate and Logic Apps reach data that is not in the cloud, such as SQL Server, Oracle, file shares or SAP. It only makes outbound connections through Azure Relay, so you do not open any inbound firewall ports.
Do I need a gateway for Power BI?+
You need a gateway when a published report refreshes from, or queries live (DirectQuery), a data source on your own network or behind a firewall. You do not need one for cloud sources the Power BI service can reach directly, such as SharePoint Online, Azure SQL with a public endpoint or most SaaS connectors.
What are the types of Power BI gateway?+
There are three. The on-premises data gateway in standard mode (once called the enterprise gateway) is shared by many users and works with Power BI, Fabric and the Power Platform, with DirectQuery and clusters. Personal mode is for one person and only Power BI refresh. The virtual network (VNet) data gateway is a Microsoft-managed gateway injected into your Azure VNet, for Azure data behind private endpoints, and needs a Fabric, Premium P or A4+ capacity. Microsoft recommends standard mode for on-premises data.
Which ports does the Power BI gateway need?+
Only outbound ports. Microsoft lists TCP 80, 443, 5671, 5672 and 9350 to 9354 to Azure Relay (*.servicebus.windows.net) plus 443 to the Power BI and Microsoft Entra sign-in domains. No inbound ports are needed. If your firewall only allows 80 and 443, turn on HTTPS mode in the gateway app.
Is the Power BI gateway free?+
Yes. The on-premises data gateway software is free to download and run. You still need the right Power BI licences (Pro, Premium Per User or a Fabric/Premium capacity) for the reports that use it, and you pay for the Windows machine it runs on. The VNet data gateway is different: it needs a Fabric (F), Premium (P) or A4+ capacity.
Why is my Power BI gateway offline?+
The usual causes are the gateway machine being off or asleep, the Windows service stopped, a firewall or proxy blocking Azure Relay ports, or a gateway version older than the last six releases Microsoft supports. Restart the service, run the Network ports test under Diagnostics, enable HTTPS mode if only 443 is open, and update to the latest monthly release.
Sources
- What is an on-premises data gateway?, Microsoft Learn (Jan 16, 2026)
- On-premises data gateway architecture, Microsoft Learn (Jan 27, 2026)
- Install an on-premises data gateway, Microsoft Learn (Aug 10, 2026)
- Adjust communication settings for the on-premises data gateway, Microsoft Learn
- What is a virtual network (VNet) data gateway, Microsoft Learn (Nov 10, 2025)
- Create virtual network (VNet) data gateways, Microsoft Learn (Sep 29, 2026)
- Troubleshoot the on-premises data gateway, Microsoft Learn
Keep reading
Software and ToolsAutomate Patch Management for Remote Teams: NinjaOne ReviewWant to automate patch management for remote endpoints? This NinjaOne review covers its patching workflow, policies, reporting, pricing approach, and practical limits. · 7 min read
Software and Tools5 Best Direct Mail APIs for CRM-Triggered, Multi-Touch CampaignsCompare five direct mail APIs on CRM triggers, multi-touch sequences, tracking and pricing, then build and test your first automated mail campaign. · 9 min read
Software and ToolsChoosing a Manufacturing Process for Unique and Low-Volume PartsLearn how to select the right manufacturing process for low-volume parts, balancing cost, quality and production speed. · 7 min read