Azure Function App not deploying correctly via DevOps

Cameron Grimshaw-Jones 16 Reputation points
2022-07-12T10:14:16.597+00:00

Hello,

I'm currently trying to create a deployment pipeline within Azure DevOps to deploy a python function app. My pipeline looks a bit like this at the moment:

  1. Install python 3.8
  2. Use the built in task to deploy the function app
  3. Install Azure Func tools
  4. Run AZ powershell script to build the function app and install the requirements: func azure functionapp publish <FUNCTION_NAME> --build remote

Firstly I tried running steps (1) & (2), however when I test the function app this wasn't installing anything in my requirements.txt folder

I then added steps (3) & (4) to try and fix the problem but the problem remained.

I then installed Azure Func tools on my local & ran the above command in (4). This then fixed the above issue and my function started working correctly.

Two questions:
Why are steps (1) & (2) not sufficient on their own to deploy a function app
Why do steps (3) & (4) work on my local but not within the devops pipeline?

Let me know if you need any further info

219769-image.png

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

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,486 Reputation points
    2022-07-14T04:57:55.817+00:00

    @Cameron Grimshaw-Jones ,

    Thanks for reaching out to Q&A.

    Please refer to the below YAML file which is the recommended approach to deploy Azure python functions
    https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops?tabs=dotnet-core%2Cyaml%2Cpython#example-yaml-build-pipelines

    pip install command in the yaml file should take care of installing the modules present in the requirement.txt file

    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.