0

I have created a python project in VS Code and deployed it on Azure Function with all the required file like requirements.txt. Code is running successfully on my local machine but giving error when I am running it on Azure Function as "No module named 'requests'". My requirements.txt file consist of following elements:

azure-functions
requests
PyJWT
cryptography

So Is there any way to manually install this package on Azure Functions Linux VM. I am using consumption plan of Azure functions

1
  • 1
    Have you pip installed your requirements.txt? Commented May 2, 2021 at 19:39

1 Answer 1

1

Code is running successfully on my local machine but giving error when I am running it on Azure Function as "No module named 'requests'".

Your function can run successfully locally, indicating that requests has been installed.

You can try to use this command to generate your requirements.txt in case the requirements.txt created by yourself is wrong:

pip freeze > requirements.txt

enter image description here

Then you can try to redeploy, if it is not successful, you can try to deploy your function using this command:

func azure functionapp publish <function app name> --build remote

<function app name> is the name of your Azure Function App in your Azure Portal.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.