Use Pandas in Azure Functions

Viewed 3062

Trying to create a basic Python Function and use it in Azure Function App(Consumption based). Used the HTTP Template via VS Code and able to use and get it deployed on Azure. However when I try to use "Pandas" in the logic, I get the error which I am not able to rectify. Me being a rookie in Python. Can you suggest how to rectify ?

Tool Used : VS Code , Azure Functions Tools Python version installed locally : 3.8.5 Azure Function App Python Version : 3.8

enter image description here

enter image description here

1 Answers

It seems the pandas module hasn't been installed in your function on azure. You need to add the pandas module into your local requirements.txt and then deploy the function from local to azure. It will install the modules according to the lines in requirements.txt.

You can run this command in "Terminal" window to generate the pandas line in your requirements.txt automatically.

pip freeze > requirements.txt

After running the command above, your requirements.txt should be like:

enter image description here

Related