Understanding SQL connection timeouts/bad gateway messages
When working with SQL queries or Insert/Update statements, you will find that the action is reasonably reliable. However, when you are connecting to an on-premises server that is part of the infrastructure, there may be several points of failure, not including the database server itself, which may be busy. Requests will be queued, and other queries may have exclusive access, meaning that your request will have to wait. Once the wait window has elapsed (typically, the default is 2 minutes), the request may retry if you have set the policy to do this, or the action will mark it as a failure.
Connection wait timeout errors
If you are running a complex SQL query or script that takes a long time to process (if the logic app has not heard back within 2 minutes), the logic app may produce an error, along with a timeout message:
If you ever experience...