← Back to Articles         
Azure Pipelines – Implementing CI/CD in Azure DevOps

Azure Pipelines – Implementing CI/CD in Azure DevOps

Published on 08 Oct 2026     7 min read Azure DevOps
Azure Pipelines Fundamentals

1. What is Azure Pipelines?

Azure Pipelines is a Continuous Integration (CI) and Continuous Delivery/Deployment (CD) service provided by Azure DevOps.

It helps developers automatically build, test, package, and deploy applications whenever code changes are made in a Git repository.

Instead of manually building and deploying an application every time, Azure Pipelines automates these activities.

Simple example

Suppose you are developing an ASP.NET Core Web API application using Visual Studio 2026.

Without Azure Pipelines:

  1. Developer writes code.

  2. Developer manually builds the application.

  3. Developer manually runs tests.

  4. Developer publishes the application.

  5. Developer copies the published files to a server.

With Azure Pipelines, these steps can be automated when code is pushed or merged into a configured branch.

2. Why do we need Azure Pipelines?

The main purpose is to automate the software delivery process.

Without Azure Pipelines

With Azure Pipelines

Manual builds

Automated builds

Manual testing

Automated tests

Manual deployment

Automated deployment

More human errors

More consistent deployments

Slow release process

Faster releases

Difficult to track releases

Build and deployment history

Real-world use: In enterprise applications such as banking systems, Azure Pipelines helps teams build and test changes consistently and deploy approved releases to SIT, UAT, and Production environments.

3. How does Azure Pipelines implement CI/CD?

Typical Azure Pipelines CI/CD workflow

Developer

Commit and push code

Azure Repos / GitHub

Git push or PR triggers pipeline

CI Pipeline

Build
Test
Publish
Creates deployable artifact

CD Pipeline

Deploy to SIT
Deploy to UAT
Production approval
Deploy to Production
Illustrative workflow. Actual triggers, tests, approvals, and environments depend on pipeline configuration.

Step 1: Continuous Integration (CI)

CI automatically validates code changes.

When a developer pushes code or creates a Pull Request, a configured CI pipeline can:

  • Restore NuGet packages.

  • Compile the application.

  • Run automated unit tests.

  • Perform code quality checks.

  • Publish build artifacts.

Example: A developer merges code into main. Azure Pipelines builds the .NET application and executes unit tests. If the build or tests fail, the pipeline reports failure.

Step 2: Continuous Delivery / Deployment (CD)

CD automates the release process after a successful build.

The pipeline can:

  • Download the build artifact.

  • Deploy to SIT.

  • Deploy to UAT.

  • Wait for Production approval.

  • Deploy to Production.

Important difference:

  • Continuous Delivery: The application is ready for release, but Production deployment may require manual approval.

  • Continuous Deployment: Every qualifying successful change can be deployed to Production automatically without manual approval.

4. Important components of Azure Pipelines

Component

Purpose

Pipeline

Defines the complete automation workflow

Trigger

Determines when the pipeline starts

Stage

Logical phase such as Build, Test, or Deploy

Job

Group of steps executed as a unit

Step / Task

Individual operation such as dotnet build

Agent

Machine that executes pipeline jobs

Artifact

Output files generated by the build

Environment

Deployment target such as SIT, UAT, or Production

Service Connection

Securely connects pipelines to external resources

The hierarchy is:

Pipeline
 ├── Stage: Build
 │    └── Job: BuildJob
 │         ├── Step: Restore
 │         ├── Step: Build
 │         └── Step: Test
 │
 └── Stage: Deploy
      └── Job: DeployJob
           ├── Step: Download Artifact
           └── Step: Deploy Application

Stages contain jobs, and jobs contain steps.

Microsoft Learn
+2

 

5. YAML Pipeline Example – ASP.NET Core Web API

Azure Pipelines supports two configuration approaches:

  • YAML Pipeline: Defined using an azure-pipelines.yml file and stored with the source code.

  • Classic Pipeline: Configured through the Azure DevOps graphical interface.

YAML is generally recommended for new pipelines because the configuration can be version-controlled and reviewed with the application code.

Microsoft Learn

 

Example: Build, test, and publish a .NET application

trigger:
  - main

pool:
  vmImage: 'windows-latest'

variables:
  buildConfiguration: 'Release'

steps:

- task: UseDotNet@2
  displayName: 'Install .NET SDK'
  inputs:
    packageType: 'sdk'
    version: '8.0.x'

- script: dotnet restore
  displayName: 'Restore NuGet Packages'

- script: dotnet build --configuration $(buildConfiguration) --no-restore
  displayName: 'Build Application'

- script: dotnet test --configuration $(buildConfiguration) --no-restore
  displayName: 'Run Unit Tests'

- script: dotnet publish ./MyWebApi/MyWebApi.csproj --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/publish
  displayName: 'Publish Application'

- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.ArtifactStagingDirectory)/publish'
    artifact: 'drop'
  displayName: 'Publish Build Artifact'

Replace the example project path with your actual Web API project path. This example implements CI; deployment requires additional CD configuration.

Explanation of important YAML properties

Property

Explanation

trigger: main

Runs when code is pushed to main

pool

Selects the agent machine

variables

Defines reusable configuration values

UseDotNet@2

Installs the required .NET SDK

dotnet restore

Restores NuGet packages

dotnet build

Compiles the application

dotnet test

Runs automated tests

dotnet publish

Generates deployable application files

PublishPipelineArtifact@1

Stores the output for later deployment

6. How do you create an Azure Pipeline?

In Azure DevOps:

  1. Open your Azure DevOps organization and project.

  2. Navigate to Pipelines → Pipelines.

  3. Select New Pipeline.

  4. Select the source repository, such as Azure Repos Git or GitHub.

  5. Choose an existing YAML file or configure a starter pipeline.

  6. Save the azure-pipelines.yml file.

  7. Run the pipeline.

  8. Review the build logs, test results, and published artifacts.

After configuration, subsequent pushes to configured branches can automatically trigger the pipeline.

7. How does deployment work?

After the CI stage completes, a CD stage can consume the generated artifact and deploy it.

For example, a pipeline can deploy an ASP.NET Core Web API to Azure App Service, IIS, a virtual machine, or a container platform.

A Production deployment stage can be configured to wait for approval before continuing. Azure DevOps environment approvals are configured through the environment's Approvals and checks, rather than directly inside the YAML file.

Microsoft Learn

 

8. Advantages and disadvantages

Advantages

Disadvantages / Challenges

Automates repetitive activities

Initial configuration takes time

Detects build failures early

Complex pipelines require YAML knowledge

Improves release consistency

Agent capacity can affect execution time

Supports approvals and security checks

Incorrect configurations can cause deployment failures

Provides deployment history

Requires maintenance and monitoring

9. Important interview questions and answers

Q1. What is the difference between Azure Repos and Azure Pipelines?

Azure Repos stores and manages source code using Git. Azure Pipelines automates building, testing, and deploying that source code.

Q2. Does Azure Pipelines require Azure Repos?

No. Azure Pipelines can also integrate with GitHub and other supported repositories.

Q3. What is an agent in Azure Pipelines?

An agent is a machine that executes pipeline jobs. It can be Microsoft-hosted or self-hosted.

Q4. What happens if a build fails?

The pipeline reports the failure, and subsequent stages that depend on its success are normally skipped.

Q5. What is a build artifact?

A build artifact is the output of a successful build, such as published .NET application files, which can be used during deployment.

Q6. Can we deploy to SIT, UAT, and Production using one pipeline?

Yes. A multi-stage YAML pipeline can define separate deployment stages, conditions, and approvals for each environment.

Q7. What is the difference between a CI pipeline and a CD pipeline?

CI validates and packages code changes. CD takes validated artifacts and delivers or deploys them to target environments.

10. Interview-ready answer

Azure Pipelines is a CI/CD service in Azure DevOps used to automate application builds, testing, and deployment.

When developers push code to Azure Repos or GitHub, a configured CI pipeline automatically restores dependencies, builds the application, runs tests, and generates build artifacts.

The CD pipeline then uses these artifacts to deploy the application to environments such as SIT, UAT, and Production. We can configure approval checks before Production deployment.

Azure Pipelines supports YAML and Classic pipelines, Microsoft-hosted and self-hosted agents, and multi-stage deployments.

Its main benefits are faster releases, consistent deployments, early error detection, and reduced manual effort.

Key interview point: Azure Repos manages the source code, while Azure Pipelines automates the process of building, testing, and delivering that code.

For further reference: Microsoft Azure Pipelines documentation.

← Back to Articles