You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running my Python code in Synapse Jupiter notebooks on Azure Synapse. I am trying to connect to Synapse DB with pyodbc library using Managed identity. I am getting Login Timeout Error.
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
I
Python: 2.7.17
pyodbc: 4.0.30
OS: Azure Synapse VM, 64 bit
DB: Synapse DB
driver: {ODBC Driver 17 for SQL Server}
Code snippet:
driver='{ODBC Driver 17 for SQL Server}'
try:
conn = pyodbc.connect('DRIVER='+driver+';SERVER=tcp:'+server+';PORT=#####;DATABASE='+database+';Encrypt=yes;Integrated Security=false;TrustServerCertificate=no;Connection Timeout=30;Authentication=ActiveDirectoryMsi;')
conn.autocommit=True
cursor=conn.cursor()
print(f"connection established with the SQL DB")
except Exception as E:
print(f"Error occurred while establishing connections with Synapse DB", E)
Make sure the managed identity is enabled on the VM, and that the server is reachable from it. The "timeout expired" suggests it couldn't connect to the server.
I am running my Python code in Synapse Jupiter notebooks on Azure Synapse. I am trying to connect to Synapse DB with pyodbc library using Managed identity. I am getting Login Timeout Error.
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
I
Code snippet:
driver='{ODBC Driver 17 for SQL Server}'
try:
except Exception as E:
print(f"Error occurred while establishing connections with Synapse DB", E)
Error:
('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
Please help me on this.
The text was updated successfully, but these errors were encountered: