Azure function deployment of single Python script and process of installation of requirements.txt in Azure Functions.

Yasir Khan 1 Reputation point
2022-11-18T15:38:41.507+00:00

Hey There,
I am completely new to Azure. I recently deployed my Python Script on Azure Functions (HTTP). It worked completely fine for me. The problem I faced is when my Python script needed some packages to be installed like (pandas, psycopy2). Although I put them in requirements.txt file. And after deployment requirements.txt is stored in root directory (same as of host.json) but I am getting import error.
I don't really know how to install these packages in azure function.
Any help would be really really appreciated.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Cristian SPIRIDON 4,486 Reputation points Volunteer Moderator
    2022-11-19T05:28:54.853+00:00
    0 comments No comments

  2. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-11-23T04:36:23.65+00:00

    @Yasir Khan Thanks for reaching out. If the modules can be installed using pip, then you can mention the same in your requirements.txt
    But in case if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
    You can refer to python troubleshooting document for more details.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.