Preface – This post is part of the SAP on Azure series.
Table of Contents
Introduction
A pipeline is a user defined flow of deployment steps. Azure too provides an option to design a pipeline. Azure Pipelines combines powerful automation activities such as Continuous Integration (CI) and Continuous Deployment (CD) to test, build and deploy developer’s code. In this article we will try to understand all the important aspects of Azure Pipeline.
Azure Pipelines Overview
Under Azure Pipeline we will discuss the following activities performed by a Change Manager:
- Pipelines
- Releases
- Library
Although, we have these all options available under Azure Pipelines:
Pipelines
Pipelines within the Pipelines (as shown above) is the place where we define a build. A build is a deployable file (also referred a drop in DevOps) that is further transferred to Releases for deployment. We can automate the operation of build, and that is then referred as Continuous Integration. We will learn creation of Pipelines in detail here.
After successful completion of build, the Pipelines build looks like this:
Releases
Releases under Pipelines is the place where we deploy the drop or build to a defined destination or environment. We can automate the Releases too, and that is then referred as Continuous Deployment. We will learn creation of Releases in detail here.
After completion of Release, the pipeline looks like this:
Library
All the files that are used within Pipelines and Releases are saved here, under Secure files tab. We can access these files wherever we want. Many times we need to save a file at DevOps level and use it only during build or deployment. In that case, you can save the file within Library and use it whenever and wherever required.
The library within Azure DevOps looks something like this:
Azure Pipelines Flow
Let’s understand in simple words the flow of a pipeline:
- Before a pipeline is build, a Repository is created
- When a new Repository is created, it just has master branch
- You need to create dev, release and prod branch with certain policies (According to your requirement)
- Now, you need to create a Pipeline. There are two ways to create a pipeline: One with the help of YAML, it adds a YAML file to your base branch, and secondly manually adding the tasks or stages in pipeline
- Once you have created a pipeline, you can run it with the branch you want. On success, the pipeline creates a drop file (or artifact) that can be used by Release for deployment. You can add a trigger A trigger tells a pipeline to run, in this case you can triggered it manually.
- Now, you need to create a Release. Here, you need to specify the sourcee. the build pipeline and a trigger to tell when to start deployment. Based upon the available environment, we will do configuration in Release and Create Release after that.
- Once we start a Release or Build, the task to build or deploy is assigned to Azure Pipelines Agents. These agents can be seen within Agent Pool Jobs. An Agent is a cloud infrastructure that runs a job. In our use case, it will run build and deployment respectively.
- Once the Agent completes its job, the Release Pipeline will mark your stage as green.
That’s it. You have successfully created, configured and ran a pipeline in Azure DevOps.
References
Check key concepts related to Azure Pipelines here: https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/key-pipelines-concepts?view=azure-devops
0 Comments