Symptoms
- Refresh history shows failures with messages about the gateway being unreachable or offline.
- Or:
The credentials provided for the SQL source are invalid, or OAuth token expired errors. - Executives see yesterday's numbers.
1. Check the gateway status
In the Power BI service: Settings > Manage connections and gateways > On-premises data gateways. Each member of the cluster shows its status.
On the gateway server:
Get-Service PBIEgwService
Restart-Service PBIEgwService
Get-Content "C:\Users\PBIEgwService\AppData\Local\Microsoft\On-premises data gateway\GatewayInfo*.log" -Tail 50
(Log path depends on the gateway service account; the gateway app's Diagnostics > Export logs collects them.)
| Finding | Cause | Fix |
|---|---|---|
| Service stopped | Server reboot, crash, patching | Start service, set to automatic |
| Service running, gateway offline in service | Outbound connectivity to Azure Relay / Service Bus blocked | Step 2 |
| Gateway "needs update" | Version too old; unsupported versions can stop working | Update the gateway |
| Service account password expired | Service can't log on | Step 3 |
2. Network test
Run the network ports test in the gateway app (Diagnostics > Start new test). The gateway needs outbound HTTPS (443) to Azure endpoints and, unless forced to HTTPS, outbound TCP 5671-5672 and 9350-9354. A proxy or firewall change is a common cause.
Test-NetConnection -ComputerName login.microsoftonline.com -Port 443
3. Gateway service account
If the domain account running the gateway had its password changed or expired, the service fails to start. Either update the service logon in the gateway app (Service settings > Change account) or switch back to the default NT SERVICE\PBIEgwService if your data sources use explicit credentials.
4. Data source credentials
Failures that name a data source (not the gateway) are credential problems:
- SQL login password rotated → update the connection in Manage connections and gateways.
- OAuth sources (SharePoint, Dataverse, Azure SQL with Entra) → re-enter credentials in the semantic model settings; tokens expire if the owner left or their account changed.
- Service principal secrets used for sources expired → rotate and update.
Find all failed refreshes quickly with PowerShell:
Connect-PowerBIServiceAccount
$ws = Get-PowerBIWorkspace -Scope Organization -All -Filter "state eq 'Active'"
foreach ($w in $ws) {
$ds = Get-PowerBIDataset -WorkspaceId $w.Id -Scope Organization -ErrorAction SilentlyContinue
foreach ($d in $ds) {
$h = Invoke-PowerBIRestMethod -Method Get -Url "groups/$($w.Id)/datasets/$($d.Id)/refreshes?`$top=1" -ErrorAction SilentlyContinue | ConvertFrom-Json
if ($h.value[0].status -eq 'Failed') { "{0} / {1}" -f $w.Name, $d.Name }
}
}
5. Re-run refreshes in order
Trigger the critical models first, so the gateway and sources aren't flooded:
Invoke-PowerBIRestMethod -Method Post -Url "groups/<workspace-id>/datasets/<dataset-id>/refreshes" -Body '{"notifyOption":"MailOnFailure"}'
Tip
Tell users when data is current again; put a banner on key reports during the incident so nobody makes decisions on stale numbers.
Prevent it next time
- Run a gateway cluster with at least two members on separate servers.
- Keep gateways within supported versions; patch monthly.
- Use a service account or managed credentials owned by the platform team, not personal accounts.
- Alert on refresh failures for critical models (refresh failure emails to a team mailbox, or monitoring through the REST API).