Publish function with poetry instead of requirements.txt

Gilberto Diaz 41 Reputation points
2021-11-17T23:51:54.41+00:00

I have several functions within an Azure Function App. I have several dependencies I'm utilizing and I decided to use poetry instead of pip. That left me with a poetry.lock file instead of requirements.txt. After running...

$ func azure functionapp publish my-project
Getting site publishing info...
requirements.txt is not found. requirements.txt is required for python function apps. Please make sure to generate one before publishing.

Is it that poetry.lock is not supported at all or there is a way to deploy utilizing poetry?

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

Accepted answer
  1. Samara Soucy - MSFT 5,141 Reputation points
    2021-11-18T02:01:41.59+00:00

    Pip is used in Azure in order to build your project, and poetry is not currently supported there. By building the project locally you can use poetry instead. The main downside is that it means that the upload will be larger since you are including both your source and the dependencies. Specifically how to set this flag will depend on your deployment pipeline, but if you are using functions core tools you can use the --build local flag: func azure functionapp publish <APP_NAME> --build local

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.