Azure Functions are a key part of the Microsoft Cloud computing platform. Recently, while building out some Azure Functions for a client of ours, I ran into an unexpected problem while deploying them. I thought I’d share what I found.
The problem arose during setup of the CI/CD pipeline. Like most Azure implementations, we wanted to setup our build and release pipelines using Azure DevOps, which allows us to automatically run unit tests during check-in and automatically deploy code to Azure Function Apps. The setup was extremely smooth with Azure DevOps integration since the codebase was being stored in Azure Repos. The default branch of code (master) deployed perfectly to the Azure Function App.
As smooth as this was, however, I hit a wall when trying to deploy the code from the development branch to a development slot of the Function App. The Azure DevOps deployment logs were not particularly helpful, and web searches turned up little on the problem. After spending a good deal of time experimenting, digging through logs on server, and reading through the project Kudu source code, it become clear there is a problem using Zip Deployments. The reason this was so difficult to track down and there is not much information out there about is because it’s only a problem under the following conditions:
- You’re deploying a non-default branch (not master), such as a feature or dev branch
- The deployment method is using:
- An Azure Function App’s integrated Deployment Center
- An Azure DevOps pipeline using an Azure Functions task
Both of these deploy using ZipPushDeploy, which at the time of this writing counts on the source branch being the default (master).
Taking some advice from fellow business partner and Azure expert, Byron McClain, I tried using an Azure App Service Deploy task from the release pipeline. Since this task’s advanced options let you choose Web Deploy over the default Zip Deploy, I was back in business. This is our work-around until the good contributors at Project Kudu can patch the issue.
Happy Azure Trails!
About Ronin Consulting – Ronin Consulting provides expert software development consulting services. Since we are staffed with seasoned technology experts, we are able to adapt to fit almost any software project’s needs. For more information about Ronin Consulting, please visit our website.