Software and Tools

Power BI Gateway Explained: Setup, Configuration & Best Practices

What the Power BI on-premises data gateway does, standard vs personal vs VNet, requirements, firewall ports, step-by-step setup, clusters and common fixes.

By Amjid Ali · · Updated · 9 min read

microsoft power bi course
In this article
  1. Quick answer: set up a Power BI gateway in 6 steps
  2. What is the Power BI gateway and how does it work?
  3. Standard vs personal mode vs VNet data gateway
  4. Requirements before you install
  5. Firewall and proxy: the ports the gateway needs
  6. Step-by-step: install and register the gateway
  7. Add a data source and schedule refresh in the Power BI service
  8. Gateway clusters for high availability
  9. Common Power BI gateway errors and fixes
  10. Best practices
  11. 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

  1. Pick an always-on, wired Windows Server 2019/2022/2025 machine (not a laptop and not a domain controller).
  2. Download the standard mode gateway from Microsoft and run the installer as a local administrator.
  3. Sign in with your work or school (Microsoft Entra ID) account.
  4. Choose Register a new gateway on this computer, give it a unique name and save the recovery key somewhere safe.
  5. In the gateway app, go to Diagnostics > Network ports test and make sure it reports Completed (Succeeded).
  6. 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 how does it work?

The gateway is a bridge between your local data sources and Microsoft's cloud. When a report refreshes, the Power BI service puts the query on Azure Relay (Service Bus); the gateway, which keeps an outbound connection open, picks it up, runs it against your database using credentials it decrypts locally, and sends the results back over the same outbound channel. Credentials are encrypted in the cloud and only decrypted on the gateway machine.

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.

Standard vs personal mode vs VNet data gateway

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

  1. In the Power BI service, select the Settings (gear) icon > Manage connections and gateways.
  2. Select New, choose On-premises, pick your Gateway cluster name, enter a Connection name and the Data Source Type (for example SQL Server).
  3. 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.
  4. Choose the authentication method (Windows, Basic or OAuth2), enter credentials, set the privacy level and select Create.
  5. Under Manage users, give the report authors User access to that connection (not admin access to the whole gateway).
  6. 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.

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.

  1. Install the gateway on a second server.
  2. When registering, tick Add to an existing gateway cluster, select the primary gateway and enter its recovery key.
  3. 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.

Official references: What is an on-premises data gateway?, Install a gateway, Communication settings and Troubleshoot the gateway.

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 is the difference between standard mode and personal mode?+

Standard mode is for teams: many users and data sources, works with Power BI, Fabric and the Power Platform, supports DirectQuery and clusters for high availability. Personal mode is for one person, works only with Power BI import refresh, cannot be shared and has no clustering. Microsoft recommends standard mode.

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.