Thanks for reaching out to Q&A forum.
Azure python function worker does come with a ODBC 17 driver, so there are no issues with the drivers
This issue might occur due to the below reasons
- The instance of the SQL Server Database Engine is not running. so please check if the SQL server is up and running. Also please check if there are any issues at the SQL side.
- When there are network problems or firewall protection at the SQL side that is preventing the Function app/ADF from accessing the DB
Also please try to specify the connection string with pipe mode and check if it helps
conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};ServerName=Provider=SQLOLEDB.1;SERVER=.\testsv;DATABASE=test;Persist Security Info=False;UID=sa;PWD=xxxxx;Data Source=np: