Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

502 bad gateway error - On Prem SQL Database

(0) ShareShare
ReportReport
Posted on by 19

Hello All, 

 

I am trying to create a flow to export data from an on premi sql database and then import it into an excel spreadsheet. 

 

When trying to run the flow I am getting a 502 Error, status: Bad Gateway. I have used this gateway for file connections on prem and it works OK. Setting up the flow I am able to see the table I am trying to retrieve, so I would presume its ok. 

 

I have also tried using another gateway installed on a different server, and I am getting the same error. 

 

Has anyone else experience this, or has a way to resolve it. 

 

Thanks in advance. 

 

{
"error": {
"code": 502,
"source": "flow-apim-europe-001-francecentral-01.azure-apim.net",
"clientRequestId": "5267d0ee-8928-49c7-abd4-ea6ac014c6af",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "Incorrect syntax near the keyword 'FROM'.\r\nclientRequestId: 5267d0ee-8928-49c7-abd4-ea6ac014c6af",
"source": "sql-we.azconn-we.p.azurewebsites.net"
}
}
}

 

 

  • Tyrrell94 Profile Picture
    Tyrrell94 19 on at
    Re: 502 bad gateway error - On Prem SQL Database

    Hi @v-zhos-msft ,

     

    Here is a screenshot of the error after it has run. I don't believe I can use this connection without a Gateway as it is an on-prem database? Unless I am wrong with that. 

     

    {
    "error": {
    "code": 502,
    "source": "flow-apim-europe-001-francecentral-01.azure-apim.net",
    "clientRequestId": "8c5c26a7-4eb4-45fd-8ea8-05748fc8235a",
    "message": "BadGateway",
    "innerError": {
    "status": 502,
    "message": "Incorrect syntax near the keyword 'FROM'.\r\nclientRequestId: 8c5c26a7-4eb4-45fd-8ea8-05748fc8235a",
    "source": "sql-we.azconn-we.p.azurewebsites.net"
    }
    }
    }
     
     
    Thanks,
    Andrew

    Run error.PNG

    Thanks

    BadGateway.PNG

  • v-zhos-msft Profile Picture
    v-zhos-msft on at
    Re: 502 bad gateway error - On Prem SQL Database

    Hi @Tyrrell94 ,

    Could you please share a full screenshot of the run history with the error message?

    You can rebuild the connection without gateway for a try.

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • Tyrrell94 Profile Picture
    Tyrrell94 19 on at
    Re: 502 bad gateway error - On Prem SQL Database

    Hello, 

     

    Thanks for your reply. 

     

    I tried it again this morning and I am still getting the same error.  I have attached an image of the setup of my flow. It is set up as you have shown, but I am still getting the same error, which leads me to believe it could be a problem with the gateway? Am not sure really, I can't see why it wouldn't be working. 

     

    Kind Regards,

    Andrew

     

    Flow Setup1.PNG

  • v-zhos-msft Profile Picture
    v-zhos-msft on at
    Re: 502 bad gateway error - On Prem SQL Database

    Hi @Tyrrell94 ,

    The error code 502 indicates that the failure is temporary or transient. 

    As the error message said, you have used the Incorrect syntax near the keyword 'FROM'.

    Could you please share a screenshot of your flow's configuration?

     I have made a test on my side, and the flow works will:

    Capture2.PNG

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard

Featured topics