Getting Started with Azure DevOps Pipelines

Sharanya Shenoy
Version 1
Published in
4 min readApr 20, 2021
Photo by Christopher Gower on Unsplash

Azure DevOps Pipelines is a cloud-based service to expedite and simplify the DevOps tasks — continuous integration (CI) and continuous delivery (CD). This platform allows to continuously build, test and deploy to any platform and cloud service. It works with any programming language and project type. Azure Pipelines helps to establish quality code and consistency that’s easily available to users by providing a quick and easy way to automate the CI/CD processes.

Why use Azure DevOps Pipeline?

· 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.

Let’s build a simple pipeline

For demonstrating, let’s take a simple example. We will see how we can take the code for a simple python application, build the docker image and push it to an existing Azure Container Registry using Azure DevOps Pipelines.

We want to push the image to the container registry called “TestContainerRegistryN”. Currently, it does not contain any repositories.

Some pre-requisites:

· Microsoft Azure account

· Azure Subscription

To create Azure DevOps Pipelines:

Step 1: Log in to the Azure cloud portal and search for “Azure DevOps organization”. Click on the same from the suggestions below.

Step 2: Create an organization and project under it.

Step 3: Click on the project. It will appear like this:

Step 4: Click on Repos. Either import your code Git or push your code from local to the Repo here. You can create as many repos under a project as required.

The code for the application is added under the Test repo as shown below.

Step 5: Create a new Build Pipeline.

Click on Pipelines.

Click on Create Pipeline. Click on Use the classic editor option.

Since, our code is pushed to Azure Repos, select the Azure Repos Git option, and select the right Repository and branch. And Hit Continue.

In the next stage, type docker in the search bar and Select the template ‘Docker container’.

Click Apply.

The first task is to Build an Image. Select the Azure Subscription and the Container Registry (where you want to push the Docker Image). Also, mention the location of the Dockerfile from the repository and the desired Image name.

Click on the next task — Push an Image.

Again, select the Azure subscription, desired container registry, and image name. Please remember, to keep the same Image name as in the previous step.

Now, click on save and Queue.

Now click on Save and Run.

You can now see that the pipeline is queued for execution and soon it goes to the running stage.

You can also view the logs to check for any errors by clicking on Agent job 1.

Once, all the stages are completed, and you see a green tick, that’s the indication that the pipeline was executed successfully. The docker image must be pushed to the Azure container Registry.

Let’s check. Voila!! It’s there.

This was a small use-case to show how pipelines can be created in Azure DevOps Pipelines. You can also enable continuous integration easily, meaning, every time a change is being made and pushed to the code repository, this pipeline will be auto-triggered.

Follow me on medium and stay tuned for my future posts on Azure DevOps Pipelines.

About the Author

Sharanya Shenoy is an associate consultant at Version 1, who has been working in the Innovation Labs since March 19, innovating with several disruptive technologies. A post-graduate in Data Science, Sharanya’s main focus areas are machine learning and AI.

--

--

Sharanya Shenoy
Version 1

I am a Post-Grad in Data Science, now working for Version 1 Innovation Labs exploring new cutting-edge technologies.