ComputeOnCloud

← Blog

Deploy Azure Functions with Jenkins

January 5, 2023

A straightforward way to continuously deploy code to Azure Functions from Jenkins: zip the build and push it via the zip-deploy REST API.

curl -X POST https://<user>:<password>@<function-app>.scm.azurewebsites.net/api/zipdeploy -T <zipfile>

Setup

  1. Get your deployment credentials — found in your function app’s properties in the Azure portal, as part of the deployment trigger URL.
  2. Configure Jenkins — store the function app’s authentication details as global credentials (dollar signs need escaping with a backslash).
  3. Build the pipeline — a Jenkinsfile that builds a zip archive from the project, verifies the artifact exists, deploys it via the curl request above, and checks for an HTTP 200 or 201 response before reporting success.

One setting worth knowing about

For Linux-based function apps, if you want Azure to run the build (e.g. installing packages) during deployment, set:

SCM_DO_BUILD_DURING_DEPLOYMENT=true

This gives teams already using Jenkins a reliable CI/CD path into Azure Functions without introducing a second deployment tool.