Closed SebastianDeChiara closed 1 year ago
It's possible the Function App doesn't have ODBC Driver 18 installed. Perhaps it only has ODBC Driver 17, in which case you could try using that instead, i.e. in your code, do something like this:
pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server}
...
To see what drivers are available to pyodbc, try using pyodbc.dataSources() and pyodbc.drivers(), i.e.:
import pyodbc
print(pyodbc.dataSources())
print(pyodbc.drivers())
Thank you, this was useful to know what drivers the virtual machine has. This helped me solve the issue.
I'm stuck in an error which I've been researching for a while now. I have looked at all the related issues and have found no solution within them.
I have Python code that I want to use in a Function App with a time trigger that runs every day at 06:00. The code:
Calls an API, downloads data.
Cleans the data.
Connects to a database using pyodbc module.
Inserts data into the database.
I then create the function app, configure it, and, locally, it's running perfectly, executing the code everyday at 06:00.
Then I create a resource and deploy the function app on Azure. The function executes properly at the configured time. However, when it runs, I get the error.
https://pastebin.com/FWBECeWq
This is the overview of the function app:
https://imgur.com/a/XDetHzk
Could it be related to the fact that the application is hosted on Linux and I'm using pyodbc driver for Windows?