Franklin
Franklin

Reputation: 19

import pyodbc in Azure WebJobs

just wonder is there a way to use pyodbc in a python WebJob

I want to set up a scheduled web job which will periodically fetch data from Azure database

However there's always error loading the pyodbc module, even if I upload the compiled version and add path in my script. anyone knows how to use pyodbc in an Azure WebJob?

Thanks!

Upvotes: 0

Views: 487

Answers (1)

Julien Moreau-Mathis
Julien Moreau-Mathis

Reputation: 36

Get the working PyODBC : To use PyODBC you should compile it in its 32bits version (very important) with Python 2.7 or Python 3.4

Or install Python 2.7 or 3.4, 32bits, and type the command "pip install pyodbc"

Use in Azure WebJob Put the PyODBC.pyd file in the root directory of your job and it should work.

Note : If your PyODBC library isn't in a 32bits version, you should have the error "... Not a valid Win32 application"

Upvotes: 1

Related Questions