Azure Functions & App Services Run From Package — Infra-As-Code

Marcus Tee
6 min readNov 9, 2021

Azure Functions and Azure App Service are one of the most used Platform-As-A-Services provided by Microsoft Azure, to remove the complexity of server management and allows developer to focus on application code. There’s a tight integration with IDE, such as Visual Studio Code, and Visual Studio, deployment is simply one click away.

Azure Extensions on Visual Studio Code. Deployment to Azure Functions and App Services is as simple as clicking that button.

This method is great for small scale application, quick development, or test environment. For organizations with DevOps practises, this manual deployment process will then be replaced by continuous integration and continuous deployment pipelines such as GitHub Actions and Azure Pipelines.

Snapshot for Azure Pipeline to deploy to Azure Functions.

These two are the most straightforward options for deployment. Recently I was creating contents for some documentation, which requires me to create deployment template, and share with public. In Azure context, it would be Azure Resource Manager Template (ARM Template). ARM Template is a fantastic way to accelerate deployment, and it can be used as a mechanism on “Infrastructure-As-Code”.

Example for deployment. Click on that button will bring you to Azure portal with a custom form for parameters. Fill those in and wait for the magic to happen.

Because of this exercise, I discovered “WEBSITE_RUN_FROM_PACKAGE” options, which makes the template creation fuss free. In short, instead of deploying to the instances directly, you create a zip package, store it in a location that Azure can access. Azure Functions or Azure App Service will then pull this zip file, extract it and run the code. Azure Functions support multiple languages such as C#, Node, Python etc, and the creation is similar.

Let me walk through the process for compiled programming language (I will use C# as an example), and interpreted language (Python as an example). For ease of reference, I will use Azure Functions, but the steps are identical for Azure App Service 😉

[1] Azure Functions in C#

C# is a compiled programming language, hence developers need to build the code to generate binary before execution. Azure Functions or…

Marcus Tee

Curiosity driven, continuous learning. Knowledge explorer. GitHub: https://github.com/guangying94