Closed J04N4 closed 1 year ago
Check the list returned by pyodbc.drivers()
to see what ODBC drivers are available to your Python app on the Azure Portal.
@gordthompson On my local machine i have the following ODBC drivers:
Fine, but that does not tell you anything about the drivers that are — or are not — installed on the other machine (to which you deploy your application).
@gordthompson The Function App is associated to an App Service Plan that is Consumption (serverless) and runs on Linux. I don't think I can manage or install things on those, not to my knowledge
Well, that environment seems to have pyodbc installed so they may have already provided some version of msodbcsql ("ODBC Driver xx for SQL Server"). pyodbc.drivers()
on the remote system would tell you that.
@gordthompson It seems like they had the odbc driver 17 for sql server installed by default on the container. I change it in my code to match it and it fixed.
Thank you for the explanation
Please first make sure you have looked at:
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
I'm using pyodbc to establish connection to sql db in my python code. Everything works fine locally, but when I deploy the Function App and I run it on the Azure Portal, I get the "Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")". error
I installed the driver locally on my Windows machine and I installed and imported pyodbc on my python environment. The OS used in the function app environment is Linux Often it is easiest to describe your issue as "expected behavior" and "observed behavior".