Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

connect to sql db



I have tried to connect to our SQL server DB from Power Apps connect directly but i got an error. so please help me to fix this issue.


Thank you


Kudo Kingpin
Kudo Kingpin


A few things to look into : 

  • Connectivity : if your DB is on-prem, the problem may come from the gateway. Make sure it's up and running, and ideally that another program (ex : power BI) can connect to it. If you DB is in the cloud (ex: Azure SQL DB), there may be firewalls rule preventing power apps to connect. Also be aware that firewall rules may exist independtly on the server level and on the DB level. Fun stuff ^^
  • Authentication : maybe you can reach the server but your identity is not recognized by the DB. Test your username/password in another client like SSMS or Azure Data Studio you are allowed on that database.
  • Authorization : maybe you can connect and are recognized by the server, but the owner of the data did not give you permission to read or write the data. If you can connect but don't see any tables, it probably points to that.

Also if possible, maybe choose the general help channel for this kind of topic rather than the News and Annoucements.

Good luck!


I can connect to SQL DB from excel, power Bi, crystal report. only power apps i can't. i think there is some thing in power apps. I have checked all what you mentioned but still can't connect.


Best regards;


Super User III
Super User III

Hi @nsaleh 

Is this the same problem that you posted here?



If you're using the on-premises gateway, here are some things to try.

  • From the computer where you installed the on-premises gateway, install Management Studio and try connecting to your SQL Server. The point of this exercise is to establish whether your internal gateway can connect to SQL Server, and that there aren't any firewall rules that are blocking the connection.
  • Is your SQL Server name setting correct? For example, if you're using a named instance, you would enter the value sqlsvr1\sqlexpress (or whatever instance name is correct in your setup)
  • If Windows authentication fails, try using SQL Authentication instead, if your SQL Server is set up for mixed mode authentication.
  • If you need to use Windows authentication and it still fails, try entering your username in the format YOURDOMAIN\Username.
  • If you still can't connect, try connecting by IP address rather than servername. Eg instead of entering sqlsvr1 as the servername, try using (ie, the IP address that corresponds to your SQL Server).

Good luck!


Not applicable

Thanks for posting in the community @nsaleh - can you advise if you're still experiencing this issue and also review the above reply?


Thank you,



Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (42,232)