web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Connect to on premise ...
Power Apps
Answered

Connect to on premise SQL server

(1) ShareShare
ReportReport
Posted on by 29
I am trying to connect to an on premise SQL server and cannot seem to return any data. I think this is primarily down to me but need some clarification. What I have done:
- installed the data gateway coincidentally on the machine that has the SQL server I am trying to connect to
- configured the gateway and have it appearing in my power apps gateway list

When I create a new connection I am presented with entries for serve name, database name etc. What exactly should I put in here? Is the server name machinename\instancename or is it just machinename or just instancename. What do I type in the database name? Instancename\databasename or something else. I am also using the sa password for now to check connectivity, and select basic authentication. Any help appreciated, can't seem to find anything that tells me how this works.
Categories:
  • dimazaid Profile Picture
    Microsoft Employee on at

    hi @Jonty,

    What do you mean by instance name in this context? what have you tried and didn't work?

    The server name is the machine name where you have the database running in. 

     

    What you could do to verify the connection, is try connecting via SQL server management studio: https://msdn.microsoft.com/en-us/library/mt238290.aspx to ensure you have the right connection info and see all information about your SQL server and database.


     

  • Jonty Profile Picture
    29 on at
    I mean the instance of SQL that the database resides in. I have tried pretty much every combination I can think of. I can connect via management studio fine, with the connection details of servername\instancename along with the SQL authentication credentials. This loads the databases in the instance accordingly.
  • dimazaid Profile Picture
    Microsoft Employee on at

    Have you tried "servername\instancename" for the server name, and database name in the database name section? And choosing the basic authentication (not windows) if you're doing SQL auth
    What error is it returning? or is it connecting but not showing any data? 
    Do you see any errors in the gateway logs? Here's some info on how to get these logs: https://powerapps.microsoft.com/en-us/tutorials/gateway-reference/#troubleshooting-1

     

  • Jonty Profile Picture
    29 on at
    I tried the ip of the server rather than localhost\instancename. The error I get is the generic a "network related instance not found" etc. I am thinking the issue is more my lack of understanding of how the data gateway works. My assumption is that it gives essentially a proxy that prevents having to open up SQL ports and also encrypts the data. This is then passed through the gateway to the connector. And because you can specify the server, I am guessing it can access anything on that subnet that is normally accessible from management studio.

    It's a frustrating problem because it's hard to troubleshoot without knowing how the connection details should be correctly formed.
  • Jonty Profile Picture
    29 on at
    And just to complete my answer I have tried the following:
    Server: serverIP\instancename
    Database:databasename

    Server: serverIP
    Database:instancename\databasename

    I am now wondering having looked at the gateway documentation whether the fact it runs as a local service is preventing it from accessing data on the network. Perhaps changing th service it runs under to networkservice will make it work?
  • Verified answer
    Jonty Profile Picture
    29 on at

    Not to worry, figured the problem out. I have dual network cards and the database was only set to communicate on one of them. And in answer to the question:

     

    Server name: servername\instance

    database: databasename

     

     

  • dimazaid Profile Picture
    Microsoft Employee on at

    Glad you got it figured out! If possible, please mark this post as solved/closed.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Jonty, that did the trick....

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard