Azure DevOps CI/CD 101 | Continuous Integration and Continuous Delivery
This article explains the basics of Azure DevOps and implements CI/CD pipelines.
Introduction
Using Azure DevOps doesn’t really imply that you may be following CI/CD.
Continuous Integration (CI) is a method of software development. Developers often integrate code into a shared repository, preferably many times each day. Each integration build should be verified by an automated build or automated tests. As an example, SonarQube integration will be mentioned later in the article.
For CI/CD, we usually follow the process outlined below.
Possible use cases
Consider Azure DevOps and CI/CD operations for:
· Accelerate application development and development lifecycles.
· Adding quality and consistency to the automated build and release process
· Increasing application stability and uptime.
Creating repository
For the simple microservice that can be created in the example, the code from the Github repo has been cloned into the Azure Repo. The Github repo can also be also used directly when creating the Pipeline without duplicating the Github repo.
Build pipeline
Create a pipeline
In this field, from which repository the code will be taken will be selected.
Continuous Integration (CI)
SonarQube integration
SonarQube’s integration with Azure DevOps allows you to maintain code quality and security in your Azure DevOps repositories. It is compatible with both Azure DevOps Server and Azure DevOps Services.
- Import your Azure DevOps repositories — Import your Azure DevOps repositories into SonarQube to easily set up SonarQube projects.
- Analyze projects with Azure Pipelines — Integrate analysis into your build pipeline. Starting in Developer Edition, SonarScanners running in Azure Pipelines jobs can automatically detect branches or pull requests being built, so you don’t need to specifically pass them as parameters to the scanner.
- Report your Quality Gate status to your pull requests — (starting in Developer Edition) See your Quality Gate and code metric results right in Azure DevOps so you know if it’s safe to merge your changes.
from “Browse marketplace” on Azure DevOps, search “SonarQube” and click “Get it free” button.
You can choose which collection it will be for and click the “Install” button.
Then SonarQube extesion will ready!
- Secondly, we will generate a token for SonarQube.
SonarQube → Administrator → MyAccount → Security
We will name the token to be used for Azure DevOps and click “Generate” button. We will use this token for Azure Devops soon so make sure you save this token.
After that, we need to configure Azure DevOps.
SonarQube integration with Azure DevOps has been completed.
Reference Links:
- https://docs.microsoft.com/tr-tr/azure/architecture/example-scenario/apps/devops-dotnet-webapp
- https://docs.microsoft.com/tr-tr/azure/devops/pipelines/process/deployment-jobs?view=azure-devops
- https://www.azuredevopslabs.com/labs/azuredevops/yaml/
- https://blog.opstree.com/2021/04/27/sonarqube-integration-with-azure-devops/