Implementing CICD pipeline on Azure | Microsoft Azure DevOps | Zenesys

IMPLEMENTING CI/CD PIPELINE ON AZURE

4 min May 10, 2021 Somendra Yadav CLOUD Views : 4414
IMPLEMENTING CI/CD PIPELINE ON AZURE

In this article, we will be using Azure Pipelines to create a CI/CD pipeline for a .NET project. The Azure CI/CD pipeline simplifies continuous integration and continuous delivery (CI/CD) in the application development process. You can start from the source stage with existing code on GitHub or on-premise containers. The Azure Repos can maintain a central repository, and the Azure pipelines maintain build and release pipelines for the given project. The Azure DevOps CI/CD process is a crucial process with all the required dev services.

Azure-ci-cd-pipeline.jpg

What Is Azure Devops?

Azure DevOps is a collection of services given by Microsoft Azure. It provides development services for a team to support, plan, collaborate, build, and deploy applications.

It provides integrated features in a browser or an IDE(Integrated Development Environment). Some of the services for developers are :

● Azure Repos

● Azure Pipelines

● Azure Boards

● Azure Test Plans

● Azure Artifacts

These resources are quite useful, especially Azure Pipelines. In this article, we will be using Azure Pipelines to create a CI/CD pipeline for a .NET project.

What are Azure Pipelines?

The Azure CI/CD pipeline simplifies continuous integration and continuous delivery (CI/CD) in the application development process. You can start from the source stage with existing code on GitHub or on-premise containers.

The Azure Repos can maintain a central repository, and the Azure pipelines maintain build and release pipelines for the given project. The Azure DevOps CI/CD process is a crucial process with all the required dev services. 

Apart from continuous integration and continuous deployment with Azure DevOps, these pipelines are used to construct build-deploy-test workflows used mainly in continuous testing (CT). This tests the changes in a fast and scalable routine.

Advantages Of Azure Pipelines

The Azure Pipelines can be multifactored, and in the Azure DevOps CI/CD practice, they provide various advantages:

1. Version Control Systems — Having the code into a version control system is the first step of building an Azure CI/CD pipeline. You can manage your source code in GitHub, Bitbucket, Subversion, or any other Git repository. It also supports Team Foundation Version Control (TFVC).

2. Programming Languages and Application Types — You can use different languages with Azure pipelines like Java, Ruby, C, C++, Python, PHP, Go, and JavaScript.

3. Deployment Targets — The applications with Azure CI/CD pipelines can be deployed to multiple target environments. This includes Virtual Machines, Containers, or any On-prem or Cloud Platform.

4. Package Formats — To produce packages that can be consumed by others, you can publish NuGet, npm, or Maven packages to the built-in package management repository in Azure Pipelines. You also can use any other package management repository of your choice.

5. Pricing —  It is free for public projects. But, for private projects, you can run up to 1800 minutes of pipeline jobs free per month.

                            Do You Know- How can Cloud Services Transform your Business?

Why Should I Use Azure Pipelines?

Implementing CI and CD pipelines help to ensure consistent and quality code that’s readily available to users.  And, Microsoft Azure cloud service Pipelines provides a quick, easy, and safe way to automate building your projects and making them available to users.

Use Azure Pipelines because it supports the following scenarios:

● Works with any language or platform

● Deploys to different types of targets at the same time

● Integrates with Azure Deployments

● Builds on Windows, Linux, or Mac machines

● Integrates with GitHub

● Works with open-source projects.

Creating Azure Organizations

To create an Azure organization, Search for devOps and choose Azure DevOps organizations.

Click My azure devOps organizations.Azure-DevOps-Organizations.jpgTo create new, Click Create new Organization

Provide a name for the Organization and the region where the projects under the Organizations will be hosted.
Create-new-Organization.jpg


CREATING AZURE PROJECTS

Once the Organization is created, You will be asked to create a project under an Organization.

Creating-Azure-Projects.jpg

Choose the project to be private and click Create project

CICD Pipeline Using Azure Devops Starter

Azure DevOps Starter creates a CI/CD pipeline in Azure Pipelines. You can create a new Azure DevOps organization or use an existing organization.

Azure DevOps Starter also creates Azure resources in the Azure subscription of your choice.

Azure DevOps Starter presents a simplified process for creating a Continuous Integration (CI) and Continuous Delivery (CD) pipeline to Azure. You can bring your existing code and Git repo, or you can select a sample application.

● Use DevOps Starter to create a CI/CD pipeline

● Configure access to your GitHub repo and choose a framework

● Configure Azure DevOps app and an Azure subscription

● Commit changes to GitHub and automatically deploy them to Azure

● Examine the Azure Pipelines CI/CD pipeline

● Clean up resources

Prerequisites

● An Azure subscription. You can get one free through Visual Studio Dev Essentials.

● Access to a GitHub or external Git repo that contains .NET, Java, PHP, Node.js, Python, or static web code.

Sign In to the Azure Portal

Search for DevOps starter

and click Create DevOps starter

Choose the application of your choice, For this tutorial, I will choose .NET

Choose-the-application.jpg
Click Next: Framework and then choose ASP.NET
Choose-the-Application-Framework.jpg

Next: Service, Choose Windows Web App and Next: Create

Click Authorize to Access the GitHub account to create the workflow.

Once Authorized, You will be asked to choose the organization and the project and the Subscription where the Azure DevOps pipeline will be created.
Select-Repository-and-Subscription.jpg

Click Review + Create, It will start the Deployment process.
Azure DevOps CI/CD Project is created


The Azure DevOps CI/CD Project is created, the Azure resources pane will take some minutes to load.

Now you can work with the team and make the required changes to the .NET apps with the automated CI/CD process that deploys the latest changes to the website.

On the right pane of Azure resources, click on the Browse button to view the application.
Github-Workflow-Success.jpg

                     You May Also Like: What is DevOps and its future predictions for 2021 and beyond?

Cleaning Up Resources

When you no longer need Azure App Service and the related resources that you created in this tutorial, you can delete them.

Use the Delete functionality on the DevOps Projects dashboard.