BadGateway exception adding SQL connector to Logic App - azure-logic-apps

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'."
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.

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.
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.
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.

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.

Related

Azure Purview scan to SQL Managed Instance fails

I followed this tutorial from Azure team: Connect to and manage an `Azure SQL Managed Instance in Microsoft Purview. As shown in the image 1 below, the scan process successfully tested the connection. But later the scanning fails with the following error:
Error: (3860) Unable to access sql server with the specified connection parameters. Please ensure that the connection parameters can login to 'master' db to enumerate the other databases in the sql server.
Question: What I may be doing wrong, and can we resolve the issue?
Remarks: As shown in the image below, the database selected for scanning is AdventureWorksLT2019. In Purview, for Authentication, I am using System Assigned Managed Identity (SAMI) that is the name myPurview of my purview account. And myPurview is a member of db_datareader and db_datawriter in the database. Moreover, in the New Login window of SSMS (image 2 below), when I enter myPurview as as AAD account and click ok, the login window recognizes myPurview as a principal identity successfully add it as a login. I verified it by trying the same process by adding a fake name testPuview, and the same login dialog did not recognize it and threw the error Principal testPuview could not be found or this principal type is not supported. (Microsoft SQL Server, Error: 33130).
After myPurview was successfully added as a login, I then added it to database with the read/write permissions. I also followed the Configure public endpoint in Azure SQL Managed Instance article. So, I am not sure what may be causing the error
Image 1:
Image 2:
As per my understanding, Azure purview is failing to scan your Azure SQL managed Instance. A managed VNET IR needs to be created to have the managed private endpoints enabled. Please make sure to check if the option is grey out. Managed private endpoint requires you to set up managed vnet integration runtimes first and also requires data source admin roles. Please let me know if you need further assistance on this.

Getting Error 18451: Only, or Error: 17810 when making multiple calls to database

I'm new to SQL Server. I was a postgres user before. I installed the default SQL Server on my local machine and I'm trying to get an old react with node js application of mine working with a SQL Server. When ever my frontend makes more than 1 call to the backend, if my SQL Server has admin privileges it throws
Error: 17810: Could not connect because the maximum number of '1' dedicated administrator connections already exists.
If not, it throws:
Error 18451: Only administrators may connect at this time.
I checked my database configs and it's set to MULTI_USERS, so I don't understand why I can't login without admin privileges. Can someone help me with this? I wasn't able to find anything online.
My NodeJS backend is using TypeORM to connect to the database
The dedicated administrator connection is a different kind of connection. It's not just "a connection being made by someone with administrative access". You would use the DAC when the SQL instance is having some kind problem, and you can't connect at all because resources are all tied up. SQL will reserve some resources especially for the DAC connection to make sure you can still connect.
A DAC connection can be made by specifying ADMIN: as part of your connection string, which will connect to the assigned DAC port.
You shouldn't use this for "routine" admin work. Just connect using a login with the required administrative server roles (eg, sysadmin). You definitely shouldn't use this as part of a regular application's connection string. You shouldn't be using a SQL Server sysadmin login either. Create a user with the appropriate permissions for your application, and don't use the admin connection.
Regarding your second issue: Make sure the instance wasn't set to start in single user or minimum configuration mode using startup flags. Note that this is for the whole instance, it's not the same as the configuration for an individual database.

Accessing sqlserver via Windows Azure

I am trying to access SQLserver database via my Azure account. This is because I didnt find a appropriate Database client for my Mac(Sierra) to connect to the SQLserver DB.
I encounter a firewall error when i try to query the database in the Query editorQuery editor in Azure. Can someone help on this?
*IP is configured to access.
I have reproduce your error:
We should modify SQL SERVER Firewall settings, change Allow assess to Azure services to ON. Then we can use Query Editor.

Access is denied connecting to SQL Azure database

I've deployed my project to Azure and my login page loads. When I attempt to login, it hangs for a moment and returns an "Access is denied" error. I've double and triple checked my connection string and it matches the one provided by Azure.
I've deployed to Azure in the past but it's been a while. Is there something I need to do in order to make my DB accessible? I read a couple articles about similar problems people had with remote connections. It involved turning on remote connection accessibility in SSMS, but I don't see that being the case in my situation as it's not being accessed thru Sql Server.
Are there modifications I must make to my DB to make it accessible on Azure?
Here's my error:
EDIT - I am using forms authentication for user handling if it makes a difference.
This error indicates that your Azure SQL Database is not configured to accept connections from the service you are trying to connect.
You have to Enable Windows Azure Services to connect to your Azure SQL Database Server.
To achieve that, navigate to your Azure SQL Database Dashboard and click on Manage Allowed IP Addresses, as shown bellow:
Then On this new page, make sure that Windows Azure Services are enabled (YES):
I had the same problem and found that I didn't have the database and the app service in the same location. One was in Australia East while the other was in Australia South East. I moved my app service to be in the same location as the DB and bingo. :)

SQL Server 2008 Linked Server Security

From server1, I've created a connection to a remote server (server2) with the Linked Server facilities. Both servers are on the same domain. When I log to server1 I can successfully execute my stored procedures from SQL Server Management Studio but when I execute my stored procedures from my browser application I get the following error on server 2.
Error: 18456, Severity: 14, State: 58.
Login failed for user 'sa'. An attempt to login using SQL authentication failed.
Server is configured for Windows authentication only.
I've searched the Internet and Stackoverflow for solutions but I'm not sure what's the best way to solve this issue. I'm sure it involves adding/changing database security settings but I'm unsure where to make these changes.
Thanks in advance.
Right-click the server in Enterprise Manager, select properties, goto Security, and change to SQL Server and Windows Authentication mode.
Mixed mode is required if you want to use sa or any other sql-account for authentication. However i believe that the recommended way is to keep the server at Windows authentication mode, and use domain accounts for authentication. The sa-account is the quick and dirty way.
If you have the exact same security setup on both servers, the link between them should work if you select "Be made using the login's current security context" in the linked server properties. That way, the account will be "inherited" in the connection to the linked server.
Check under Security - Logins on each of the server so that the same account is added to both servers. Also check the properties of both entries, under Server Roles you can try to add the sysadmin-role to make sure the accounts will have access to all databases on the server. You should however limit this access in live environments :)

Resources