1. Introduction
Hello! We are a writer team from Definer Inc.
In this issue, you are wondering how to create CI/CD for Azure App Service.
Let's take a look at the actual screens and resources to explain in detail.
2. Purpose/Use Cases
This article summarizes information and practices that can be helpful when you want to build CI/CD for Azure App Service.
3. What is CI/CD?
CI/CD, which stands for Continuous Integration and Continuous Deployment/Delivery, is a set of practices and methodologies that streamline the software development process to improve efficiency, quality, and speed. These practices aim to automate and integrate various stages of the development lifecycle, from code creation to deployment and beyond.
Continuous Integration (CI) refers to the practice of regularly integrating code changes from multiple developers into a shared repository. With CI, developers merge their code changes frequently, often several times a day, into a central codebase. Automated build and testing processes are triggered automatically upon each integration, ensuring that the new code doesn't introduce any conflicts or errors.
Continuous Deployment/Delivery (CD) extends CI by automating the release and deployment of code changes to production environments. In Continuous Deployment, every successful code change that passes all tests is automatically deployed to production, enabling rapid and frequent releases. Continuous Delivery, on the other hand, follows a similar process but leaves the final deployment decision to the development team, allowing them to choose when to deploy the code to production.
4. What is Azure App Service?
Azure App Service is a Platform-as-a-Service (PaaS) offering provided by Microsoft Azure. It is a fully managed service that allows developers to build, deploy, and scale web applications, APIs, and mobile backends easily. With Azure App Service, developers can focus on coding and application logic, while the underlying infrastructure management, scaling, and maintenance are taken care of by Microsoft.
Azure App Service integrates seamlessly with Azure DevOps, Microsoft's comprehensive DevOps platform, to enable Continuous Integration and Continuous Deployment (CI/CD) workflows. This integration streamlines the process of building, testing, and deploying applications to Azure App Service, making it easier for development teams to deliver software faster and more reliably.
5. Set up registry for container image storage
First, we will implement the registry as a setup for the App Service.
① Create Azure Container Registry
Login to the Azure console and access "Container Registry".
Click "Create" and enter the subscription and resource group information.
②Prepare Information to login to Azure Container Registry
The user and password information required for login can be found on the "Access Key" tab of the Container Registry Details screen.
If the administrator user is disabled, enable it.
③ Prepare Container Image
This time, we will use a container image of nginx.
Tag the image and prepare to push it to Azure Container Registry.
④ Push the container image to Azure Container Registry
Finally, push the nginx container to Azure Container Registry.
Following these below commands:
## Download nginx image locally
sudo docker pull nginx
## Tag the nginx image
sudo docker tag nginx testcicdcontainer.azurecr.io/nginx:1.0
## Login to Azure Container Registry
sudo docker login -u ${username} -p ${password} testcicdcontainer.azurecr.io
## "Login Succeeded" will be received if successful
## Push to Azure Container Registry
sudo docker push testcicdcontainer.azurecr.io/nginx:1.0
6. Creation of Azure App Serivce and CI/CD implementation
Next, we will implement App Service and CI/CD.
① Create App Service
Go to the App Service screen and click "Create New".
Select "Linux" and "Docker" for OS and startup type, respectively.
For the container image, select the nginx container from the container registry you just created.
This completes the startup of Azure App Service.
② CI/CD implementation
Next, we will implement CI/CD for the App Service.
From the App Service details screen, select "Deployment Center" > "Settings".
Select "Azure Container Registry" for the registry resource, and select docker images and tags.
Turn on "Continuous Deployment" and "Save"
③ Confirm CI/CD
Push the new docker image to the Azure Container Registry as described earlier, and the CI/CD pipeline will kick in.
The execution log can be checked from the App Service details screen under "Deployment Center" > "Logs".
You can now see that your App Service containers have been updated!
7. Cited/Referenced Articles
What is DevOps? How to build an environment using Azure and the benefits of introducing ...
High Performance for Unity Apps with Azure DevOps ...
I think it works anyway, so let's deploy it. Azure WebApps ...
【Azure App Service | Node.js】GitHub Actions for Continuous ...
Running React on Azure App Service | cloud.config Tech Blog
CI/CD in Azure App Service in 30 minutes - Qiita
CI/CD for Web Apps with Azure DevOps | cloud.config Tech ...
8. About the proprietary solution "PrismScaler"
・PrismScaler is a web service that enables the construction of multi-cloud infrastructures such as AWS, Azure, and GCP in just three steps, without requiring development and operation.
・PrismScaler is a web service that enables multi-cloud infrastructure construction such as AWS, Azure, GCP, etc. in just 3 steps without development and operation.
・The solution is designed for a wide range of usage scenarios such as cloud infrastructure construction/cloud migration, cloud maintenance and operation, and cost optimization, and can easily realize more than several hundred high-quality general-purpose cloud infrastructures by appropriately combining IaaS and PaaS.
9. Contact us
This article provides useful introductory information free of charge. For consultation and inquiries, please contact "Definer Inc".
10. Regarding Definer
・Definer Inc. provides one-stop solutions from upstream to downstream of IT.
・We are committed to providing integrated support for advanced IT technologies such as AI and cloud IT infrastructure, from consulting to requirement definition/design development/implementation, and maintenance and operation.
・We are committed to providing integrated support for advanced IT technologies such as AI and cloud IT infrastructure, from consulting to requirement definition, design development, implementation, maintenance, and operation.
・PrismScaler is a high-quality, rapid, "auto-configuration," "auto-monitoring," "problem detection," and "configuration visualization" for multi-cloud/IT infrastructure such as AWS, Azure, and GCP.