I have been using pymssql for a while with no issues. I can connect to on-prem and azure sql db.
However, we moved an on-prem db to azure MANAGED Instance and the same scripts don't work after altering the connect server variables.
conn = pymssql.connect(host='mysrv-sql.da0b68f6c.database.windows.net', user='myuser', password='mypass', database='mydb')
conn.autocommit(True)
cur = conn.cursor()
I have tried all combinations of the username (with or without @mysrv-sql, @mysrv-sql.da0b..., etc)
I just get the generic: DB-Lib 20002 Error, Adaptive Server connection failed
NOTE: I can connect to the managed instance using TSQL or SSMS on the same machine python is executed.
FYI: Using wheel 2.1.4 with FreeTDS, I have a feeling the problem is related to Managed Instance forcing Encryption