Implement CI/CD with GitHub – Deploy Azure Functions – DEV Community

1 Create an Azure Function App
rg, storage account, function app, not deployment is set up yet.
To set up deployment, webapipython | Deployment Center, we do that later

2 Create a GitHub repository

3 Clone GitHub Function repository

$ git clone

4 Link Azure Function App with GitHub Repository

init project, name is same as function app name in azure-automation
PS C:\giti2023\test-webapipython> func init webapipython

cd .\webapipython\
Create a function
C:\giti2023\test-webapipython\webapipython> func new –name testpy1 –template “HTTP trigger” –authlevel “anonymous”

spawnmarvel/test-webapipython: Test simple web api in python with az ci/cd and git actions (

Test the function
func start


Save and commit the changes

5 Deploy Function App
This brings us to the last step, automating the deployment of our Functions with CI/CD using GitHub Actions

webapipython | Deployment Center

Choose workflow

Add the repos (I think I added organization previous)

When you save on the configuration above, you will notice that on the GitHub repository there is a new automation workflow that is automatically created as well as a new repository secret.

The workflow will be located in a special folder called .github/workflows that is automatically created by Azure:


Note that the Publish Profile is actually stored as a GitHub Action Secret, this was also automatically created by Azure as part of the workflow YAML file:

Actions secrets (

Let’s trigger this workflow manually and deploy our function into the Azure Function App. In GitHub navigate to Actions, select the workflow and then Run Workflow:

Run it


Hm, error

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v1. For more information see:

GitHub Actions: All Actions will begin running on Node16 instead of Node12 | GitHub Changelog

$ git pull origin main

# edit from 2 to 3
 - name: Checkout repository
        uses: actions/checkout@v3

Git add, commit and push.

Run actions again


ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirements.txt’

Hm, moved requirements.txt from




It started deploying at once


I have called the function URL, but it takes time…to build…

Last step I did was to edit the yaml file, did not read enough from the previous post

      - main
    paths: # elo. Added this
      - 'webapipython/**' # elo. Added this

  # elo AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
  AZURE_FUNCTIONAPP_PACKAGE_PATH: 'webapipython' # elo set this to the path to your web app project, defaults to the repository root

And now it works

Git actions

App in portal

App on URL



Lets make a small change to the code.

return func.HttpResponse(
             "Github Actions: This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",

Push to git and deploy automatic from actions

Visit URL

When updating yaml file, the Github actions does not trigger, put a comment in a file with code and it will trigger, all changes.

For now we will lock the actions


quickguides/security at main · spawnmarvel/quickguides · GitHub

Update 03.11.2023

Set allow actions for test

And we have the new tab with actions

Do some code changes

git add., git commit -m “03.11.2023 wf”

git push origin main

and it is done

Now visit URL -

set back