My use-case is as follows:I have a http trigger azure python function. This function should query from azure sql database.
I have drafted a python azure function and used pyodbc package (added in requirements.txt) to query the azure database with appropriate connection string. However, at the time of execution, I am getting below driver not found error. Can you help? How am I supposed to install a driver in a serverless platform like azure functions? Let me know if you have any other way to query azure database from python azure functions. thanks!
Error message below:
Result: Failure Exception: Error: ('01000', " [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)") Stack: File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/dispatcher.py", line 458, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/dispatcher.py", line 701, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/finaltemp/init.py", line 20, in main conn = pyodbc.connect(connection_string)