'BadGateway exception adding SQL connector to Logic App

When I try to add a SQL Server connector to my Logic App I get an error stating "Please check your account info and/or permissions and try again. Details: BadGateway More diagnostic information: x-ms-client-request-id is 'xx-x--xxxxx--xxx'."

Sql Server Connector

I have Contributor access for the Logic App resource. When I try to add a new API Connection or if I try to use an existing connection it throws the same permission error.

Can anyone help me here to understand what additional access/permission is required to access this connector in a Logic App?

Note: My SQL database is on Azure not on-prem.



Solution 1:[1]

We have reproduced the same from our end and checked the same. You are receiving this error is might be due to any of the following reasons.

  • The firewall settings that you have arranged.
  • Connection settings while adding the SQL SERVER Connector.

The firewall settings that you have arranged.

For this you can go to your Firewall settings from overview pane and set the start and end ip addresses. enter image description hereenter image description here

Connection settings while adding the SQL SERVER Connector.

For this make sure while you are adding Authentication type for the connector to give correct credentials. enter image description here

For better results, make sure you are choosing Use both SQL and Azure AD authentication while creating SQL SERVER and set admin credentials for both SQL and Azure AD Authentication types so that you can use any of the either options.

enter image description here

Solution 2:[2]

What caused this for me was calling a scalar valued function in a stored procedure block instead of ... a stored procedure. Once I switched to an actual stored proc everything was fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SwethaKandikonda-MT
Solution 2 Vincent Vancalbergh