Issue Summary

I’m trying to connect to a SQL Server on Azure. I’ve entered all information, and can confirm it works with the same credentials when using other software. My IP is also white listed on Azure SQL Server.

I get the error:

Connection Test Failed:
DB-Lib error message 20002, severity 9: Adaptive Server connection failed (myservername.database.windows.net:1433)

I’ve tried with TDS versions 7.0, 7.2, and 7.3

Technical details:

  • Redash Version: 5.0.0-beta
  • Browser/OS:Chrome v. 67 on MacOS v. 10.12.6
  • How did you install Redash: Using Docker

Got it working now with TDS 7.0

Hello,

How did you get this working? I can connect with the default admin user, but I can not connect with a new user with read role only.

I am also receiving this error today as I’m trying to connect my selfhosted redash to my azure sql server db. Anyone have any insights on how to resolve this issue? Thanks

Can you share information about the error you receive? How have you installed Redash?

The error that pops up is
DB-Lib error message 20018, severity 20: General SQL Server error: Check messages from the SQL Server DB-Lib error message 20002, severity 9: Adaptive Server connection failed (myserver.database.windows.net:1433)

I installed onto my Azure Linux VM via the setup.sh script. I’ve setup Redash many times, but this is my first time connecting to an Azure SQL as the DB.

Interesting. Try changing your username in the data source setup screen to include the server name. For Azure, the username requires the server name as well - so instead of "myusername" you need "myusername@server-name-here".

This solution comes straight from the pymssql documentation:

IMPORTANT : Do not use username@server.database.windows.net for the user parameter of the relevant connect() call! You must use the shorter username@server form instead!

We had the same error earlier this week. This change solved it.

Yes, doing username@servername in the username field did the trick! I am able to connect now. Thanks for the help.

Even after using username@servername and TDS 7.0 / TDS 7.1 versions, we are still not able to connect to Azure MSSQL server instance.

We still get following error -

Connection Test Failed:

DB-Lib error message 20002, severity 9: Adaptive Server connection failed (cdx-sop-dev.database.windows.net:1433)

Also, We couldn’t find any helpful logs to debug this issue.

Technical details:

  • Redash Version: [8.0.0.b32245]
  • How did you install Redash: Using Docker
  • Deployed onto Azure Kubernetes cluster.

Are you certain the firewall on your database will accept a connection from your Redash instance’s IP address?

I checked the connectivity to datasource from k8s pod using following command -

TDSVER=7.1 tsql -H host_url -p 1433 -U username@server -D db_name

Password:
locale is “C.UTF-8”
locale charset is “UTF-8”
using default charset “UTF-8”
Setting db_name as default database in login packet
1>

^^ Success.

I can able to connect using above mentioned command. but Redash is not able connect using same set of parameters.

I’m getting error while doing test connection as below,
DB-Lib error message 20018, severity 20: General SQL Server error: Check messages from the SQL Server DB-Lib error message 20002, severity 9: Adaptive Server connection failed (redashsqlserver.database.windows.net:1433)

Can you please help me ?