Skip to main content

Azure web app service with continuous integration and continuous deployment

By August 8, 2023September 4th, 2023Azure, Blogs, CICD, Cloud, DevOps

Introduction:

Azure Web App Service is a platform as a service it’s quickly built, deploys, and scales your application and it is fully managed infrastructure on Azure services.

App Service also comes with the benefit of Auto Scaling of instances or VM and computing power and provides a secured endpoint that can be authorized and integrated with any standard identity provider like Azure AD. With multiple deployment slots and we can also test our app before releasing it into the production environment and make use of swapping with another slot where production deployment completes within a couple of seconds.

The purpose of this document is to determine all the requirements for installing the Azure app service and enabling continuous integration and continuous deployment.

Azure Web App Features:

  • Azure Web App service supports multiple languages like ASP.NET, ASP.NET Core, JAVA, RUBY, NODE.JS, PHP, and PYTHON and supports the Azure PowerShell scripts as background services.
  • It automatically scales up and scales down your Web Application and you can host your application on infrastructure sites.
  • it is easy deployment for your application from source code repositories such as GitHub Bitbucket Visual Studio Team Services etc.
  • Web App is a serverless code deployment or script whenever you want and it’s optimized time for deployment.
  • Web App Services support tools like Visual Studio and Visual Studio Code make it easier to create, deploy and debug your code.
  • The Operating System and language frameworks are automatically patched and maintained via App service.
  • Security Purpose Web App Service is supported by ISO (International Standard Organization), SOC (Security Operation Centre), and PCI (Payment Card Industry).

App Service Scaling :

In web apps in two types of scaling :

  • Vertical Scaling
  • Horizontal Scaling

Vertical Scaling :

  • Scale Up :

Scale-up means increasing the computing power of infrastructure to support heavy workloads by increasing CPU power and storage efficiency.

  • Scale Down :

Scale-down means decreasing the computing power of infrastructure in case the website hit goes down by decreasing the CPU power and storage efficiency.

Horizontal Scaling :

  • Scale Out :

Scale-out means horizontal scaling means the number of instances of the app is increased to distribute the traffic load.

  • Scale In :

Scale-in means the number of instances of the app is decreased to reduce cost in off seasons when traffic on the web app goes low.

How to create an Azure web app in the Azure portal :

  • Log in to Azure Portal
  • Go to the Azure portal and log in to your account and home pages will appear with the option of ‘Create a Resource’ click on it.
  • Under ‘Create a Resource’, you will see various categories and search ‘Web App’ under the popular section.
  • Click on the start button.
  • The following screen appears with the heading ‘Create Web App’, where you will be asked to configure the following details:
  • Subscription          – It specifies the valid subscription plan for the Azure Portal.
  • Resource Group    – you can create a new resource group here also.
  • Name                       Specify the name you want to keep for your Web App                                                           

                                   Instance.

  • Publish                    It will provide you with two options: Code and Docker                                                                                   

                                  Container.

  • Runtime Stack       It specifies the technology with which you want to deploy

                                  the app. We have selected .NET Core 6.0 (LTS)

  • Operating Sys       It helps in selecting the hosting platform for the application.

                                  Windows and Linux are two options.

  • Region                    Select the region.
  • SKU and Size        It will specify how many apps you can create under this                                                                                        subscription. By default, it shows Standard S1.
  • After filling in all mentioned details, click on ‘Create’ and show to below image.

Here we click on Create button and the deployment process gets initiated. The following screen view when the deployment process gets completed then select ‘Go to Resource’.

When we go to the resource we created, we will see that the A web app is created. Refers to the below image.

  • After that, click on the web app created by you underlined in the below image and there will find a URL and CLICK to reach the next screen.

When you click on the URL, it will tack you to the next screen indicating the created app. As we haven’t deployed any code, it asks us to deploy the code.

Enable the continuous integration from Azure App Service.

The web app is successfully deployed and goes to the Deployment Centre and select Continuous Integration and Continuous Deployment

Here in the source section, you can select Azure Repos and you have to select multiple options like Bitbucket, GitHub, etc.

Once you select Azure repos it will populate to show your DevOps organization and select the Organization, Project and Repository.

Once has been selected click on save and this will fetch the latus code from your repository and deploy it on Web App and you same browse the same from the browse option above.

Azure DevOps CICD Process in Web Apps: In this architecture diagram, we describe the Azure DevOps pipeline features to help our application to get build with Azure DevOps CICD pipeline to Azure Web Apps.

  • Developer needs to check the source code to the Azure code repository.
  • Azure Continuous Integration pipeline triggers the build by cloning the application code from the Azure repository to either Microsoft hosted agent or self-managed build agents.
  • Continuously deploy triggers on specific environments with the artifacts and specific arguments.
  • Once the release has run successfully and checked the web application deployed on Azure Web Application and browse to the URL provided in the portal.
  • The logs tab will provide details of the release process steps to run on the web application.

Azure DevOps Build Pipeline for Continuous Integration (CI):

Continuous Integration or CI is a process in which a developer commits your source code changes to the version control repository in this case, it is the Azure DevOps repo in which the build is performed either using a schedule or every check-in.

 Azure DevOps Release Pipeline for Continuous Deployment (CD):  

The build artifacts are available in the drop folder as in the build and we will be creating them now for deployment as artifacts and then deploying on the Azure Web application. 

Release pipeline means to help your team to continuously deliver software to your customers at a faster and lower risk and you can fully automate the testing and delivery of your software in multiple stages. Or set up your automated processes with approvals and on-demand deployments.

Process of Continuous Integration and Continuous Deployment on Azure DevOps.

  • Go to the Azure DevOps: https://dev.azure.com
  • Please create an Azure DevOps project.

Select a pipeline and create a new pipeline.

Now choose a build template provided by Azure DevOps like ASP.NET core.

  • Here below image, I have selected Azure DevOps provides multiple templates to build your applications to develop in .net, java, node.js, Php, etc.
  • In the Azure pipeline select Azure Agent Pool or Self-Hosted Agent Pool.
  • In the above image we can Select a repository, Project and Branch Name.
  • Select one by one build task execution steps shown in below :
  • Use NuGet 4.4.1 :

In this task, NuGet provides the tools developers need for creating, publishing, and consuming the 4.4.1 packages.

  • NuGet restore:

The NuGet restore task restores the packages used in the project i.e., build version, NuGet versions, etc after that it restores the specific tools which specific in the project files and adds the artifacts to the restore steps artifacts containing different packages and the Azure artifacts manage all the packages from one place.

  • Visual Studio Build:

In this task build your project and its dependency and show the output in the **\*.sln extension files are also added according to project type and the setting which we configure in the argument i.e. –configuration $(Build Configuration) shows build configuration, out of a folder.

  • Test:

The test command is used to execute unit tests in the project, .net test command builds the unit test result we used a specific argument to run the test result “/p: CollectCoverage=true /p: CoverletOutputFormat=cobertura

  • Publish Symbol Path:

In this task to use of index your source code and publish your symbols to a Azure Artifact or file share.

  • Publish Build Artifacts:

In this task publish the artifacts and you can provide the path to publish and download from the drop location.

  • Run the pipeline:
  • Start the CD (Continuous Deployment):

Go to the release pipeline and we can create our own custom template as well as per our requirements like “Azure App Service Deploy”.

After adding this template, we can fill in all information like Subscription, App type, App Service Name, Connection type, Resource Group and slot as per your requirement.

 

After saving the release, you can create a new release and choose environments for release if you have added multiple release tasks.

We at Varseno, provide Azure web app service with continuous integration and continuous deployment for all business websites to improve their reliability, scalability and stability. Reach out to us for any web app services.

Sales Inquiry
close slider