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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error 502 - connecting...
Power Apps
Unanswered

Error 502 - connecting to SQL Server over VPN

(0) ShareShare
ReportReport
Posted on by 100

Hi all,

I'm attempting to connect a PowerApp to a SQL Sever. I'm on a VPN, and SSMS works fine on the same computer, but I get the below error when trying to connect. Is there anything different when trying to connect via PowerApps that I would need to change?

The server is clearly running, and I would imagine that being able to connect over VPN with SSMS would indicate that the server can accept remote connections. This isn't Flow related like a lot of the other 502 posts, and many of those don't seem to be "solved" so much as they just started working again.

 

Spoiler (Highlight to read)

{

  "error": {

    "code": 502,

    "source": "unitedstates-002.azure-apim.net",

    "clientRequestId": "d16f049f-bc96-4d92-a8ff-7fad035754c5",

    "message": "BadGateway",

    "innerError": {

      "status": 502,

      "message": "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: TCP Provider, error: 0 - The wait operation timed out.)\r\nclientRequestId: d16f049f-bc96-4d92-a8ff-7fad035754c5",

      "source": "sql-eus.azconn-eus.p.azurewebsites.net"

    }

{  "error": {    "code": 502,    "source": "unitedstates-002.azure-apim.net",    "clientRequestId": "d16f049f-bc96-4d92-a8ff-7fad035754c5",    "message": "BadGateway",    "innerError": {      "status": 502,      "message": "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: TCP Provider, error: 0 - The wait operation timed out.)\r\nclientRequestId: d16f049f-bc96-4d92-a8ff-7fad035754c5",      "source": "sql-eus.azconn-eus.p.azurewebsites.net"    }

Thanks!

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @RMDNA ,

     

    Connecting to your on-premises data sources from PowerApps, you need to use on-premises data gateway. For more information, please refer to:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-azure-sqldatabase

    https://powerapps.microsoft.com/en-us/blog/connect-to-your-on-premises-data-sources-using-on-premises-data-gateway-from-powerapps/

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at

    Hi @RMDNA are you still experiencing this error? Did the above reply help? 

     

    @Anonymous 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard