When a Power BI on-premises data gateway keeps going offline, the cause is almost always one of five things: the computer it runs on sleeps, restarts or loses its connection; the gateway version is too old; a firewall or proxy is blocking the ports it needs; the Windows service account it runs under has a problem; or, in a cluster, the members are on different versions. Start by opening the gateway app on that machine, checking its status, and running the built-in network ports test. That usually tells you which one it is within ten minutes.
What the gateway does
The on-premises data gateway is a small Windows service that lets the Power BI service reach data that lives inside your network: a SQL Server in the office, files on a shared drive, an on-premises ERP. Power BI talks to the gateway through Microsoft's cloud (Azure Relay), and the gateway fetches the data locally. If the gateway can't reach Microsoft's cloud, or isn't running, every scheduled refresh that depends on it fails.
You'll see it as "gateway offline" or "unreachable" in Settings, under Manage connections and gateways, or as refresh failures that mention the gateway.
Cause 1: the computer sleeps, restarts or goes offline
In small businesses this is the first thing to check. Often the gateway was installed on someone's desktop or laptop, and that machine sleeps overnight, installs updates and restarts, or goes home in a bag.
Microsoft's own guidance is not to install the gateway on a computer that might be turned off, asleep or disconnected from the internet, and not to use a wireless connection. They recommend a machine that's always on, with a wired connection. For hardware, their recommended spec is an 8-core CPU and 8 GB of RAM, with 64-bit Windows Server 2019 or later. Don't put it on a domain controller.
If your gateway is on a laptop or a shared desktop, moving it to an always-on server or a small virtual machine usually fixes "it keeps going offline" for good.
Cause 2: the gateway version is too old
Microsoft releases a new gateway version every month and actively supports only the last six releases. An old gateway can stop connecting, and some errors (such as "GatewayNotReachable" when you set credentials) are fixed simply by installing the latest version.
Check the version in the gateway app on the machine. If it's more than six months old, download the latest installer and run it over the top. Your settings are kept. If you have a gateway cluster (two or more machines acting as one gateway), update all of them, because Microsoft calls out mismatched versions in a cluster as a cause of problems.
Cause 3: a firewall or proxy is blocking it
The gateway only makes outbound connections; it doesn't need any inbound ports opened. It does need to reach Microsoft on outbound TCP ports 80 and 443, 5671 to 5672, and 9350 to 9354, and to a list of Microsoft domains including *.servicebus.windows.net, *.powerbi.com and the Microsoft sign-in addresses.
The gateway has a test built in:
- On the gateway machine, open the On-premises data gateway app.
- Select Diagnostics.
- Under Network ports test, select Start new test.
- When it finishes, select Open last completed test results.
Any port listed as closed is being blocked by your firewall or network. Send the results to whoever manages your firewall.
If your firewall only allows ports 80 and 443, turn on HTTPS mode: in the gateway app, open the Network tab, switch HTTPS mode on and select Apply. The gateway restarts and sends everything over HTTPS. New installs have used HTTPS by default since mid-2019, but older installs that were upgraded keep their old setting.
If your company uses a proxy server, the gateway has to be configured to use it, and if the proxy requires sign-in, the gateway service may need to run as a domain account that the proxy allows.
Cause 4: the service account
By default the gateway runs as a built-in Windows account called NT SERVICE\PBIEgwService, and most small businesses should leave it that way.
Problems start when someone changes it to a regular domain user account. If that account's password expires or gets changed, the gateway service can't sign in and stops. If you need a domain account (usually because of a proxy), Microsoft suggests a group managed service account, which rotates its own password. Always change the account from inside the gateway app, not from Windows Services, because Microsoft warns that doing it in Windows Services can cause logging and other issues.
Cause 5: data source credentials, not the gateway
Sometimes the gateway is fine and the refresh still fails with a credentials error. In the Power BI service, go to Settings, then Manage connections and gateways, and check the connection for that data source. A password change on a database or service account is a common trigger. Update the credentials there and test the connection.
A quick checklist when the gateway goes offline
- Is the gateway machine on, awake and online?
- Open the gateway app. Does it show the gateway as online? If not, restart the service from the app.
- Is the version from the last six months?
- Run the network ports test. Anything closed?
- Has anyone changed the service account or its password?
- If it's a cluster, are all members on the same version?
- Still stuck? In the gateway app, go to Diagnostics and Export logs, and check Event Viewer under Applications and Services Logs, On-premises data gateway service.
Standard mode or personal mode
There are two kinds of gateway. Personal mode is meant for one person and only works with Power BI. Standard mode can be shared, supports clusters, and is the one Microsoft recommends for anything the business relies on. If your company's reports run through a personal mode gateway on one person's laptop, that's worth changing even if it hasn't failed yet.
When to call someone
Most gateway problems are fixable in under an hour once you know which of the causes above it is. It's worth getting help when the ports test passes but the gateway still drops, when a proxy is involved, when you need to move the gateway to a new machine without breaking every connection, or when reports people rely on every morning are failing today.
That's what our $299 Power BI fix is for: one problem, fixed by a senior consultant, and you don't pay if we can't fix it. If you're setting up a gateway properly for the first time, or moving reports off a laptop, see Power BI advisory. And if refresh is failing because the model has outgrown its memory rather than because of the gateway, see our post on memory limit exceeded errors.
Sources: Microsoft Learn, Troubleshoot the on-premises data gateway, Adjust communication settings, Install an on-premises data gateway, Change the gateway service account.