1

I'm trying to setup a data connection from PowerApps to an on-premise SQL Server instance we have. However, I get the following error:

Microsoft SQL: 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)

I'm following this support article from Microsoft to get it set up.

Everything I've done so far:

  • The SQL Server Express instance is setup on a normal Windows 10 Pro machine we have within our domain.
  • I've created a service account on the domain to access SQL Server, and added the db_owner role for it on the database we're trying to access.
  • I've configured SQL Server to allow external connections with a non-standard port (49172), and tested this using another machine within the domain to connect using the service account, which works great.
  • I installed the On-Premise Data Gateway from Microsoft and configured it using my work Microsoft account. That works fine as well, and I can see the gateway in PowerApps listed as Live. HTTPS is enabled (recommended on this question)
  • I've added explicit rules allowing all the ports and whitelisted all the IPs suggested by MS in the support article I followed (link above).

The weird thing is if I change the username/password to something incorrect, it gives me an "invalid credentials" error, so I know it can at least hit the domain/SQL Server to authenticate. Is there a setting I'm missing somewhere in SQL Server?

chazbot7
  • 598
  • 3
  • 12
  • 34

1 Answers1

1

So, I'm an idiot and had the SQL Server name wrong. In the tutorial I watched the instructor just listed the computer name (which is what I was doing), but I needed to add a backslash and SQLEXPRESS as well.

  • Old name: DEVPC
  • New, correct name: DEVPC\SQLEXPRESS

Worked like a charm after that.

chazbot7
  • 598
  • 3
  • 12
  • 34
  • 1
    I had a similar experience, although I did not need to open any ports or add firewall exclusions, which is one of the points of the gateway. I was using `localhost\ServerName`, which did not work, but `MachineName\ServerName` worked. – Andacious Jan 11 '22 at 23:07