Using Azure DevOps CI/CD Pipelines With Azure App Services

Introduction

Today, we will look into a CI/CD pipeline solution. We will look at the process from logging a task to coding and then building and deploying to the destination application. We will look at Azure DevOps as the platform for all this process and then deploy the application to an Azure App Service as a web application.

Reference diagram

We will start with the diagram provided by Microsoft. Details are available at the Microsoft website below,

Using Azure DevOps CI/CD pipelines with Azure App Services

Components of the design

The diagram starts with the Engineer. This can be the DevOps engineer, Scrum Master, or developer. All tasks and issues are stored in the Azure DevOps Backlog. This is a list of all new features, bugs, enhancements, etc., that need to be worked on by the team. Other solutions for this include the JIRA platform, which is used to store and track issues. The code for the application is taken from the Azure Repo, which is primarily a Git repository and is worked on by the developer. Once the fix is complete, the code is saved to the repository, mainly in the respective branch created for the particular task. Once the code is merged back into the main branch, it automatically triggers a build in the Azure DevOps build pipeline. This process can also be manually triggered if required. Once the build process is complete, which could also include tests, the code is deployed to the Azure App service via the Azure DevOps release pipeline. Depending on the requirement, this process can also be triggered manually or automatically. The code is mostly deployed into a testing or UAT slot. Here, the changes are tested, and if all looks good, the slot is swapped with the production slot, and the changes are ready for use in production.

It is always a good idea to set up monitoring of our application using Application Insights. From here, we can collect real-time data on the usage, performance, and any issues on our application. Once these are collected, we can record them back into our Azure DevOps Backlog and start the process all over again. This process is mostly run in Agile sprints where a certain number of tasks are assigned to developers for a certain amount of time, e.g., two or four weeks, and this is known as the sprint cycle.

Summary

In today’s article, we looked at how to design a CI/CD pipeline solution for our application deployed in Microsoft Azure using Azure DevOps. Other alternatives are available, like GitHub actions, etc. However, I recommend using the complete Microsoft stack and Azure DevOps for an Azure application.