ODBC Driver 18 Not Found in Azure Function Using Python 3.11
I’m creating an Azure Function using Python 3.11 to write data to an Azure SQL database with the pyodbc library. However, I’m running into an issue where the ODBC Driver 18 is not found. The error message I get is:
Error: (‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘ODBC Driver 18 for SQL Server ‘ : file not found (0) (SQLDriverConnect)”)
I’ve tried the following:
- Switching to Python 3.10: The problem persists with ODBC Driver 18 and also occurs when using ODBC Driver 17.
- Checking connection string: Ensured that the connection string is correctly set up for the driver.
Environment:
- The Azure Function is running on a Linux-based plan.
- I haven’t manually installed any ODBC drivers, and I’m unsure how to do this within the Azure environment. However, I have
pyodbcandazure-functionsin myrequirements.txtfile
Has anyone encountered a similar issue or can provide guidance on setting up ODBC drivers for Azure SQL in this environment?
Thanks!
Read more here: Source link
