Not able to connect to Azure Arc Enabled MI server for Windows Authenticated only user #1251
Replies: 8 comments
-
This isn't a pyODBC problem, but in any case...
Try using ODBC Driver 18 for SQL Server? Azure Arc support was just added to it very recently. |
Beta Was this translation helpful? Give feedback.
-
Same issue is seen with ODBC Driver 18 for SQL Server as well |
Beta Was this translation helpful? Give feedback.
-
Looking at your sample connection string, that is for regular SQL authentication (users created directly on the server, and supplying their username/password credentials to server to login). It is not clear what type of account you want to login with, as "Windows Authentication" implies integrated Kerberos, and Azure Arc is relevant for AAD users. |
Beta Was this translation helpful? Give feedback.
-
The user is a part of a group "JDNET". It doesn't have regular SQL authentication enabled due to organisational constraints. |
Beta Was this translation helpful? Give feedback.
-
No, pymssql does not use ODBC. It works directly with FreeTDS. |
Beta Was this translation helpful? Give feedback.
-
You'll likely need to setup Kerberos in this scenario. |
Beta Was this translation helpful? Give feedback.
-
Do I need to change something on the server side to support Kerberos? |
Beta Was this translation helpful? Give feedback.
-
If you can already connect using that account, probably not, but give this a read: https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-authentication On the client side: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/using-integrated-authentication |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
Issue
The environment is like this :
Need a Linux +python based solution to this problem. Can something be changed in the Microsoft DRIVER in the pyodbc library to support this use case?
Connection String used :
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';ENCRYPT=yes;UID='+username+';PWD='+password+';TrustServerCertificate=yes')
Expected Behavior:
Connection should go through without any errors.
Observed Behavior:
Error received:
pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'JDNET\APC0321'. (18456) (SQLDriverConnect)")
Note : Adding a Trusted_Connection=yes in the connection string
throws this error:
pyodbc.Error: ('HY000', '[HY000] [Microsoft][ODBC Driver 17 for SQL Server]SSPI Provider: No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000) (851968) (SQLDriverConnect)')
Also since the client and server is not on same AD group setting Kerberos credentials is not possible.
Beta Was this translation helpful? Give feedback.
All reactions