Forum Discussion
On-premise data gateway cannot connect to database
We are in the process of replacing an older on-premise data gateway cluster (composed of 4 servers) running on Windows Server 2016. We had 2 new servers built with Windows Server 2025. We installed on-premise data gateways on both and configured them as a cluster.
For testing we uploaded a report to the Power BI Service. The data source is an on-premise SQL Server database. We then created a data gateway connection on the semantic model using Windows authentication. The connection was successfully created and we were able to run a refresh on the semantic model.
For a second test we uploaded another report (data source is an on-premise SQL Server databse) to the Power BI Service. We then attempted to create a data gateway connection but htis time we used basis authentication and privded an SQL Server login and password. It failed with this message:
Test-Gateway: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
With this same report we then successfully created a data gateway connection to the original data gateway cluster (running on Windows Server 2016 and to be replaced) using basic authentication.
What needs to be done for us to create a data gateway connection on the new data gateway cluster (running on Windows 2025) with basic authentication?
7 Replies
- rohit1991Super User
Hii Lorenz33
Basic (SQL) authentication requires TCP/IP connectivity, and the error “Named Pipes Provider, error: 40” means the new gateway servers cannot reach SQL Server over the required port. You need to ensure TCP/IP is enabled in SQL Server Configuration Manager, the correct SQL port (usually 1433 or a custom port) is open in the firewall, SQL Server allows remote connections, and if using a named instance, either start SQL Browser or specify the port explicitly (ServerName,Port). Once network connectivity is confirmed from the new gateway servers, Basic authentication will work.
- Lorenz33Helper IV
Thanks Rohit. The new Windows 2025 Server on-premise data gateway cluster is being tested with plans to replace the Windows 2016 Server on-premise data gateway cluster. With the Windows 2016, data gateway I am able to successfully create a connection to the same SQL Server database using basic authentication. As it works on the Windows 2016 data gateway and not the Windows 2025 data gateway, this should mean that the required port (1433) should already be open and that there are no firewall issues. Could the Windows 2025 data gateway be attempting access through a different port?
- MohdZaid_Super User
Hey Lorenz33 ,
Since Windows authentication works on the new Windows Server 2025 gateway cluster, the gateway itself is installed correctly and can reach the SQL Server. The issue is likely related to how SQL authentication (Basic authentication) is connecting. The error message about “Named Pipes Provider, error: 40” usually indicates a network or SQL configuration problem rather than a Power BI issue.
Most commonly, this happens when TCP/IP is not enabled on the SQL Server, the correct port (typically 1433) is blocked by a firewall, or the SQL Server Browser service is not running for a named instance. Windows Server 2025 may also have stricter firewall settings compared to 2016, which could explain why it works on the old gateway cluster but not the new one. Checking that TCP/IP is enabled in SQL Server Configuration Manager, confirming the correct port is open, and specifying the server name with the port number (for example, ServerName,1433) usually resolves this type of issue.
If this explanation helped, please mark it as the solution so others can find it easily.
If it helped, a quick Kudos is always appreciated it highlights useful answers for the community.
Thanks for being part of the discussion!
- Lorenz33Helper IV
Thanks Mohdzaid. The new Windows 2025 Server on-premise data gateway cluster is being tested with plans to replace the Windows 2016 Server on-premise data gateway cluster. With the Windows 2016, data gateway I am able to successfully create a connection to the same SQL Server database using basic authentication. As it works on the Windows 2016 data gateway and not the Windows 2025 data gateway, this should mean that the required port (1433) should already be open and that there are no firewall issues. Could the Windows 2025 data gateway be attempting access through a different port?
- v-aatheequeCommunity Support
Hi Lorenz33
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.