Key concepts for new Azure Pipelines. (Part 1)
A trigger initiates a pipeline execution.
Azure Pipelines Key Terms
Agent
An agent is a computing resource that runs jobs in a pipeline. Each job runs on a single agent, which could be Microsoft-hosted (e.g., an Ubuntu agent) or self-hosted.
Approvals
Approvals define validations required before a deployment runs. They act as checks, pausing the pipeline until all required approvals are completed.
Artifact
An artifact is a collection of files or packages generated during a pipeline run. These artifacts are used in later stages for deployment or distribution.
Continuous Integration (CI)
CI automates the testing and building of code whenever changes are made, ensuring early bug detection. It produces artifacts used in continuous delivery pipelines.
Continuous Delivery (CD)
CD automates code deployment across multiple stages (test, production, etc.), ensuring quality through continuous testing and monitoring.
Deployment
A deployment executes tasks in a stage, including tests, artifact deployment, and environment configuration. In YAML pipelines, a deployment job defines deployment strategies like rolling, canary, and run-once.
Deployment Group
A set of deployment target machines with installed agents. It enables grouping of agents for targeted deployments.
Environment
A collection of resources (VMs, containers, web apps) where applications are deployed. Pipelines deploy to environments after builds and tests are completed.
Job
A job contains steps that run on an agent. Jobs can run in parallel or sequentially within a stage. Agentless jobs execute tasks directly in Azure DevOps without an agent.
Pipeline
A pipeline defines the CI/CD process for an application. It consists of multiple stages, handling build, test, and deployment workflows.
Release
In classic pipelines, a release is a versioned set of artifacts along with deployment settings. In YAML pipelines, builds and releases are combined into a single multi-stage pipeline.
Run
A single execution of a pipeline, including logs, test results, and step executions. In classic pipelines, a build represents a run.
Script
A step in a pipeline that runs custom code using the command line, PowerShell, or Bash. Unlike tasks, scripts are manually written for pipeline-specific automation.
Stage
A logical boundary in a pipeline representing a phase (e.g., Build, QA, Production). Stages can have dependencies, approvals, and conditions for execution.
Step
The smallest unit of a pipeline is either a script or a task. Multiple steps make up a job.
Task
A pre-packaged script or procedure in a pipeline that automates specific actions, such as running tests or deploying artifacts.
Trigger
Triggers define when a pipeline runs, such as on a code push, scheduled time, or after another build completes.
Library
Centralized storage for secure files and variable groups, allowing values and secrets to be shared across multiple pipelines.
Pipeline runs
For each pipeline run, Azure Pipelines:
For each job, an agent:
Jobs can succeed, fail, be canceled, or remain incomplete. Understanding these outcomes helps with troubleshooting.
Pipeline processing
Pipeline Processing in Azure Pipelines
To process a pipeline for a run, Azure Pipelines follows these steps:
Variables and Processing Order
Understanding the processing order is crucial for variable usage:
Agents in Azure Pipelines
When Azure Pipelines needs to run a job, it requests an agent from the designated pool. The process differs based on whether the agent is Microsoft-hosted or self-hosted.
Parallel Jobs and Agent Assignment
Microsoft-Hosted Agents
Self-Hosted Agents
Job Preparation on an Agent
Once an agent accepts a job, it performs the following tasks:
Step Execution in Azure Pipelines
Sequential Execution of Steps
Step Isolation and Environment Variables
Creating Pipeline Variables via Logging Commands
Result Reporting and Log Collection
Live Logging and Log File Storage
List pipeline runs
The following command lists the first three pipeline runs that have a status of completed and a result of succeeded and returns the result in table format.
Show pipeline run details
The following command shows details for the pipeline run with the ID 123, returns the results in a table format, and opens your web browser to the Azure Pipelines build results page.
Add a tag to the pipeline run
The following command adds the tag YAML to the pipeline run with the ID 123 and returns the result in JSON format.
az pipelines runs tag add --run-id 123 --tags YAML --output json
[
"YAML"
]
List pipeline run tags
The following command lists the tags for the pipeline run with the ID 123 and returns the result in table format.
az pipelines runs tag list --run-id 123 --output table
Tags
YAML
Delete tag from a pipeline run
The following command deletes the YAML tag from the pipeline run with ID 123.
az pipelines runs tag delete --run-id 123 --tag YAML
YAML vs Classic Pipelines
Azure Pipelines: Automating Development Workflows
Azure Pipelines empowers developers to automate various tasks, from executing simple batch scripts to building a full-fledged CI/CD (Continuous Integration and Continuous Delivery) pipeline for their applications.
Flexible Support for Languages, Platforms, and Tools
Azure Pipelines supports various programming languages, platforms, and tools, making it a versatile choice for development teams. It offers two pipeline options:
Defining Pipelines with YAML
Creation of your first pipeline: Refer to this document (https://www.linkedin.com/pulse/what-azure-pipelines-ankit-ranjan-devops-engineer--fcj7f/?trackingId=ni%2BEuukwSPqN8jWkeYyhRg%3D%3D)