---
title: "Build Your First Azure DevOps Pipeline from Scratch"
description: "Learn to create your first Azure DevOps pipeline from the ground up. Enhance your IT skills and automate your workflow with ease."
canonical: "https://adamtheautomator.com/azure-pipelines/"
---

# Build Your First Azure DevOps Pipeline from Scratch

> Learn to create your first Azure DevOps pipeline from the ground up. Enhance your IT skills and automate your workflow with ease.

Source: https://adamtheautomator.com/azure-pipelines/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Build Your First Azure DevOps Pipeline from Scratch](https://adamtheautomator.com/wp-content/uploads/2020/01/azure-pipelines.png)

# Build Your First Azure DevOps Pipeline from Scratch

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)2 January 202011 min. read

Categories: [Cloud](/category/cloud/), [DevOps](/category/devops/)

Tags:[Azure DevOps](/tag/azure-devops/)[Azure Pipelines](/tag/azure-pipelines/)

Table of Contents

*   [Project Overview](#project-overview)
*   [Target Audience](#target-audience)
*   [Environment Requirements](#environment-requirements)
*   [Creating an Azure DevOps Organization](#creating-an-azure-devops-organization)
*   [Creating an Azure DevOps Project](#creating-an-azure-devops-project)
*   [Building an Azure DevOps Build Pipeline](#building-an-azure-devops-build-pipeline)
*   [Linking a GitHub Repo to the Build Pipeline](#linking-a-github-repo-to-the-build-pipeline)
*   [Populating Sample GitHub Repository Code](#populating-sample-github-repository-code)
*   [Inspecting and Viewing the Build Pipeline in YAML](#inspecting-and-viewing-the-build-pipeline-in-yaml)
*   [Manually Running the Azure Build Pipeline](#manually-running-the-azure-build-pipeline)
*   [Building an Azure DevOps Release Pipeline](#building-an-azure-devops-release-pipeline)
*   [Adding Artifacts to the Azure DevOps Release Pipeline](#adding-artifacts-to-the-azure-devops-release-pipeline)
*   [Creating the Azure DevOps Release](#creating-the-azure-devops-release)
*   [Manually Deploying a Release](#manually-deploying-a-release)
*   [Inspecting the Deployed Azure WebApp](#inspecting-the-deployed-azure-webapp)
*   [Cleaning Up](#cleaning-up)
*   [Your Takeaways](#your-takeaways)

Software must be written, tested and deployed into a production environment. To do so, in an automated fashion, developers and DevOps build [CI/CD pipelines](https://www.infoworld.com/article/3271126/what-is-cicd-continuous-integration-and-continuous-delivery-explained.html) or build/release pipelines that automate much of this activity.

A pipeline allows developers, DevOps teams and others to produce and deploy reliable code. In the Microsoft realm, the way to build a pipeline is with [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/get-started/?view=azure-devops) with a feature called Azure [Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/).

Azure Pipelines allow you to automatically run builds, perform tests and deploy code (release) to various development and production environments. But what if you’ve never heard of Azure DevOps or a pipeline before or have never built one with Azure DevOps? If so, this Azure Pipelines tutorial is for you.

> _Big thanks to [Peter De Tender](https://twitter.com/pdtit), Microsoft Azure Technical Trainer, for his help with this article._

## Project Overview

This is a Project article where we cover how to build a project or implement a solution. Each section will be cumulative steps that build upon the previous.

In this Project, you’re going to learn, from the ground up, how to create your first [Azure](https://adamtheautomator.com/tag/microsoft-azure/) DevOps pipeline. You’ll learn concepts like invoking builds from a Git version control commit, automatically executing tests and finally releasing packages to environments. By the end of this Project, you will have a sample e-commerce application deployed as a Azure WebApp.

This Project should take you 30 minutes to complete.

> _Note that if you follow this Project and immediately remove the resources created, you will not be charged in your Azure account. Don’t forget to remove them!_

## Target Audience

This project will cover the very basics of setting up your first Azure Pipeline in the Azure DevOps web UI. You’ll learn a lot from this project if you’re brand new to Azure Pipelines but not so much if you’ve already built your own pipelines before or are an Azure Pipelines guru.

## Environment Requirements

If you’re planning on walking through this Project, step by step, be sure, at a minimum, you have the following:

*   [An Azure account](https://azure.microsoft.com/en-us/free/search/?&ef_id=Cj0KCQjwrMHsBRCIARIsAFgSeI2Y8p9u2z9lLJjrL80sMThoQG2-FYXL73dAA6vzsFop8uCv_RQqihYaAtwAEALw_wcB:G:s&OCID=AID2000128_SEM_5nJSB71e&MarinID=5nJSB71e_286296264948_create%20azure%20account_e_c__55956187097_kwd-310735070824&lnkd=Google_Azure_Brand&gclid=Cj0KCQjwrMHsBRCIARIsAFgSeI2Y8p9u2z9lLJjrL80sMThoQG2-FYXL73dAA6vzsFop8uCv_RQqihYaAtwAEALw_wcB)
*   Already logged into the [Azure Portal](https://portal.azure.com) with global administrator or similar rights.
*   A [GitHub](http://www.github.com) account
*   An empty [Github repository created](https://docs.github.com/en/get-started/quickstart/create-a-repo)
*   [An empty Azure WebApp](https://azure.microsoft.com/en-us/get-started/web-app/) deployed using _dotnetcore 2.2_ and Linux for the platform

## Creating an Azure DevOps Organization

Because we’re starting from absolute scratch, you’ll first create the “base” object that all Azure DevOps features and services are contained within called the [_organization_](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/organization-management?view=azure-devops). The organization is where all _projects_ are stored which you’ll learn how to build in the next section.

1.  From the [Azure Portal](https://portal.azure.com/), browse to **All services**, search for _DevOps_ and _s_elect **Azure DevOps.** You can see what to expect below. This will open the **Azure DevOps** blade as you can see below.

![Azure DevOps dashboard](https://adamtheautomator.com/wp-content/uploads/2020/06/1-9-1024x517.png)

Azure DevOps dashboard

2\.  Next, click **My Azure DevOps Organizations** and provide your Azure credentials. You will be brought to a page where you can create a new organization as shown below. Once here, click on the blue **Create new organization** button.

![Create new Azure DevOps organization page](https://adamtheautomator.com/wp-content/uploads/2020/06/2-13-1024x667.png)

Create new Azure DevOps organization page

3\.  On the next page, provide a name for the organization. If you run into problems with using a specific name, be sure to check the [Azure DevOps organization naming conventions](https://docs.microsoft.com/en-us/azure/devops/organizations/settings/naming-restrictions?view=azure-devops). On this screen, also specify an Azure region closest to you. Once done, click **Continue**.

![Azure DevOps organization creation page](https://adamtheautomator.com/wp-content/uploads/2020/06/3-11.png)

Azure DevOps organization creation page

At this point, your Azure DevOps organization is created!

## Creating an Azure DevOps Project

The next step is creating a project. A project is a container for the pipeline you’ll be created, various artifacts and any other information pertaining to a particular service or piece of software.

Azure DevOps gives you the ability to create a project during the same workflow as creating an organization as performed above. If you followed along, you should now be presented with a project creation page as shown below.

1.  On the project creation page, provide a name for your project in the _Project name_ field. For this project, you’ll be using an Azure DevOps project called _devopsdemo_.
2.  Confirm the creation of the project by clicking the _\+ Create Project_ button.
3.  For now, leave the _Visibility_ set to _Private_. This ensures your project isn’t exposed to the Internet. A public project allows non-members of a project and non-signed-in users read-only access to the project’s artifacts.

![Azure DevOps project creation page](https://adamtheautomator.com/wp-content/uploads/2020/06/4-10-1024x709.png)

Azure DevOps project creation page

At this point, your Azure DevOps workspace (project + organization) has been created. If you’ve been following along, you will now have an Azure DevOps organization created called _pdtitws123_ and a project inside of that organization called _devopsdemo_.

![Azure DevOps project overview](https://adamtheautomator.com/wp-content/uploads/2020/06/5-11-1024x907.png)

Azure DevOps project overview

## Building an Azure DevOps Build Pipeline

Now that you have an Azure DevOps organization and project set up, you can now create a build [pipeline](https://azure.microsoft.com/en-us/services/devops/pipelines/) inside. The pipeline is where all the magic happens. It’s where you will create builds to perform various tasks like compiling code, bringing in dependencies and more.

1.  From the dashboard, select **Pipelines** then on **Builds**.

![Azure DevOps Builds menu](https://adamtheautomator.com/wp-content/uploads/2020/06/6-11.png)

Azure DevOps Builds menu

2\.  You will see a message telling you there are no build pipelines found yet. Click on **New pipeline** to begin creating the build pipeline.

![No build pipelines bound yet. Creating a new pipeline.](https://adamtheautomator.com/wp-content/uploads/2020/06/7-11.png)

No build pipelines bound yet. Creating a new pipeline.

3\.  You will then be prompted for where your code is stored. In this Project, the code is stored in a GitHub repository. Select **GitHub**. This is the place where code is stored and the triggers for invoking the build will come from.

![Selecting version control source](https://adamtheautomator.com/wp-content/uploads/2020/06/8-9-1024x804.png)

Selecting version control source

4\.  Once you click on **GitHub**, you’ll be prompted to provide your GitHub account credentials as shown below. _Before you begin this step, remember to have an empty GitHub repo created as defined in the Prerequisites section of this article!_

![Providing GitHub credentials](https://adamtheautomator.com/wp-content/uploads/2020/06/9-7-569x1024.png)

Providing GitHub credentials

5\.  Next, confirm the step where you are asked to authorize Azure Pipelines. This ensures Azure DevOps has permission to access your GitHub repos.

![Authorizing Azure Pipelines to access GitHub](https://adamtheautomator.com/wp-content/uploads/2020/06/10-4-883x1024.png)

Authorizing Azure Pipelines to access GitHub

### Linking a GitHub Repo to the Build Pipeline

Once you’ve provided Azure DevOps permission to your GitHub account, now link a GitHub repo to the build pipeline.

1.  Select the empty GitHub repo you have created for this Project.

![Empty source GitHub repo](https://adamtheautomator.com/wp-content/uploads/2020/06/11-3-1024x403.png)

Empty source GitHub repo

2\.  Allow the project to read, write and check source code from the repository you selected earlier. Then confirm this process by clicking **Approve & Install**.

![Confirm Azure DevOps Github integration](https://adamtheautomator.com/wp-content/uploads/2020/06/12-2-729x1024.png)

Confirm Azure DevOps Github integration

3\.  By clicking confirm, you will see an error generated as shown below. This error will happen because the GitHub Repo selected is empty.

![Error when GitHub repo is empty](https://adamtheautomator.com/wp-content/uploads/2020/06/13-2-1024x322.png)

Error when GitHub repo is empty

At this point, your GitHub repo will be linked to your Azure DevOps build pipeline.

> _You don’t have to create an entirely new pipeline every time you want to link a GitHub repo to an Azure DevOps build pipeline._

### Populating Sample GitHub Repository Code

The Azure DevOps build pipeline won’t run without some code in the GitHub repo. The code doesn’t necessarily matter at this point. To get some code in the repo, we’ll use an existing repo to clone some code from. In this repo, I have all the source code available to publish an e-commerce sample application in Azure WebApps.

The sample code for this repo will contain a sample e-commerce application called [_SimplCommerce_](https://www.simplcommerce.com/). This application is an open-source dotnetcore application that’s more realistic than the typical “hello world” project.

1.  Navigate to [this sample GitHub repo](https://github.com/iamdoingdevops/myfirstrepo) and click on _Import code_ as shown below.

![Empty myfirstrepo GitHub repo](https://adamtheautomator.com/wp-content/uploads/2020/06/14-2-842x1024.png)

Empty myfirstrepo GitHub repo

2\.  For the **old repository’s clone URL** use [http://github.com/007FFFLearning/SimplDev](http://github.com/007FFFLearning/SimplDev) and click on **Begin import**.

![Proving the repo clone URL](https://adamtheautomator.com/wp-content/uploads/2020/06/15-2-1024x736.png)

Proving the repo clone URL

When the repo import step is completed successfully, refresh the [Azure DevOps Pipeline](https://adamtheautomator.com/azure-devops/ "Azure DevOps Pipeline") window, which should allow you to continue now.

### Inspecting and Viewing the Build Pipeline in YAML

At this point, you will be at the Review phase of the pipeline creation process. You will now be presented with a representation of the build pipeline in YAML. This YAML file is automatically built based on the detection of the source code language which is dotnetcore in this Project.

> O_ne of the real benefits of Azure DevOps is the pipeline YAML. With many other DevOps tools, you have to build a pipeline file manually._

![Reviewing pipeline YAML](https://adamtheautomator.com/wp-content/uploads/2020/06/17-1004x1024.png)

Reviewing pipeline YAML

## Manually Running the Azure Build Pipeline

In a [continuous integration (CI) pipeline](https://semaphoreci.com/blog/cicd-pipeline), the build is typically triggered by a commit to source control. But, you can also manually trigger the build pipeline to run. Let’s kick off a build pipeline manually to see what happens.

If you’ve been following along, at this point, you should be to the point where you can click on **Run** to kick off the build pipeline. This will start the pipeline build process as you can see from the below screenshot.

![Pipeline starting](https://adamtheautomator.com/wp-content/uploads/2020/06/18-1024x585.png)

Pipeline starting

After a few seconds, you can see that the process will be running for macOS as shown below. The build pipeline will return information in real-time as each job and task in the pipeline runs.

![Running on the macOS build agent](https://adamtheautomator.com/wp-content/uploads/2020/06/19-1024x425.png)

Running on the macOS build agent

The build pipeline will then repeat the same process for the other operating systems (in this example) as shown below. The steps taken will vary greatly depending on how the YAML file was built.

![Running on the Linux build agent](https://adamtheautomator.com/wp-content/uploads/2020/06/20-1024x652.png)

Running on the Linux build agent

Once the build has completed, you are greeted with green checkmarks as you can see below. This screenshot indicates each platform build passed successfully.

![Successful pipeline run](https://adamtheautomator.com/wp-content/uploads/2020/06/21-1024x929.png)

Successful pipeline run

You’ve now created an Azure DevOps build pipeline!

## Building an Azure DevOps Release Pipeline

The build pipeline is created which is some great progress. If you were to stop at this point, you’d be well on your way for a complete, automated pipeline. But we’re not done! The ultimate goal of software needs to be deployed so customers can use it. It’s time to automate a release too with a [release pipeline](https://docs.microsoft.com/en-us/azure/devops/pipelines/release/?view=azure-devops)!

A release pipeline takes a _build artifact_, a result of the build process and deploys that to one or more environments. In this Project, you’re going to use a release pipeline to publish code in the GitHub repo to an Azure Web App.

1.  From Azure DevOps, click **Pipelines** and then **Releases**.

![Releases menu item](https://adamtheautomator.com/wp-content/uploads/2020/06/22.png)

Releases menu item

2\.   Next, select **New** and then **New Release Pipeline**. This launches the New release pipeline wizard.

![New release pipeline menu option](https://adamtheautomator.com/wp-content/uploads/2020/06/23.png)

New release pipeline menu option

3\.  From the template list on the right, select **Azure App Service Deployment**. You’ll see many different kinds of templates available to save time creating future release pipelines.

![Select the Azure App Service deployment template](https://adamtheautomator.com/wp-content/uploads/2020/06/24-1024x513.png)

Select the Azure App Service deployment template

4\.  Provide a description for the **Stage Name.** The stage will contain release tasks. For this project, use the name _Deploy\_to\_webapp_.

![Specify the stage name](https://adamtheautomator.com/wp-content/uploads/2020/06/25-1024x482.png)

Specify the stage name

The release pipeline should now look like the below screenshot.

![Created stage](https://adamtheautomator.com/wp-content/uploads/2020/06/26-1024x716.png)

Created stage

5\.  In the _Stages_ field, select **1 job, 1 task**. This field is where you will eventually provide the settings of the Azure Web App environment you will use for the actual deployment.

6\.  Part of the Azure App Service deployment template comes a few parameters you’ll need to define in this screen.

1.  Stage Name – _Deploy-to-webapps2_ in this example.
2.  Azure Subscription – select your subscription and confirm with **Authorize** (needs credentials)
3.  App type – Web App on Linux
4.  App Service Name – the web app you created earlier

![Setting template parameters](https://adamtheautomator.com/wp-content/uploads/2020/06/27-1024x782.png)

Setting template parameters

7\.  When done, click **Pipeline** in the top menu of your Azure Pipeline project as shown below. This will return you to the main screen and allow you to complete the next step which is specifying the [artifacts](https://docs.microsoft.com/en-us/azure/devops/pipelines/release/artifacts?view=azure-devops).

![Going back to the pipeline](https://adamtheautomator.com/wp-content/uploads/2020/06/28-1024x677.png)

Going back to the pipeline

### Adding Artifacts to the Azure DevOps Release Pipeline

Within a release pipeline, there are many different items that need to be deployed. These items are called [_artifacts_](https://docs.microsoft.com/en-us/azure/devops/pipelines/release/artifacts?view=azure-devops?view=azure-devops). _Artifacts_ put simply, are deployable components of your application. Azure Pipelines can deploy artifacts that are produced by a wide range of _artifact sources._

In this section, let’s cover how to add artifacts to the release pipeline.

1.  While on the **Pipeline** screen, click on **Add an Artifact**.
2.  The **Source Type** is already set to **Build** which is what you want since you’ll be deploying the output of the build pipeline created earlier. Choose the build pipeline created earlier in the **Source (build pipeline)** dropdown.
3.  When finished, click on **Add** to save the configuration.

![Adding an artifact](https://adamtheautomator.com/wp-content/uploads/2020/06/29-928x1024.png)

Adding an artifact

4\.  Finally, click on the **Save** button in the upper right corner of the screen to save the release pipeline.

## Creating the Azure DevOps Release

Once the release pipeline is created, you’ll then begin creating _releases_. A release is a particular run of the pipeline. Think of the release pipeline as the template and specific instances of that release pipeline as releases. Once you have a release, that release can then be deployed.

To create a release:

1.  Click the **Create Release** button in the upper right corner of the window as shown below.

![New release pipeline overview](https://adamtheautomator.com/wp-content/uploads/2020/06/31-1024x444.png)

New release pipeline overview

2\.  You’re not going to do anything fancy so at the **Create a new release** screen, accept the defaults and click on **Create**. You only have a single stage at this time and have a single version of the build artifact to deploy now.

![Create a new release item](https://adamtheautomator.com/wp-content/uploads/2020/06/32-1008x1024.png)

Create a new release item

3\.  After a few seconds, you will receive a notification (the green bar) that the release has been created as shown below. Now click on **Release-1** which will redirect you to the details of the release process.

![Click on Release-1](https://adamtheautomator.com/wp-content/uploads/2020/06/33-1024x745.png)

Click on Release-1

You have now created a release and it’s ready to be deployed!

## Manually Deploying a Release

A release is a set of instructions to perform on how to deploy a build. You’ve done all of that. Now it’s time to actually run those instructions and deploy code to an environment.

While on the _Release-1_ release you created earlier:

1.  Select the _Deploy\_to\_webapp_ stage and confirm **Deploy**. When you do so, the status will change to _In progress_ as shown below. At this point, the release is grabbing the source code from the build pipeline executed earlier and pushing it to the Azure WebApp instance.
    
    This step will initiate a job running in the back-end on an [agent](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser) copying source code and performing the actual release cycle.
    

![Stage in progress](https://adamtheautomator.com/wp-content/uploads/2020/06/1-10-1024x782.png)

Stage in progress

2\.  Click on the stage while it’s in progress. You will see any logging information shown in the console output area.

![Job log showing stage in progress](https://adamtheautomator.com/wp-content/uploads/2020/06/2-14-1024x357.png)

Job log showing stage in progress

When complete, the stage should show **Succeeded** as seen below.

![Successful stage](https://adamtheautomator.com/wp-content/uploads/2020/06/2.2-1024x687.png)

Successful stage

If all went well, the release should have finished and you should now have a web app published to an  Azure Web App!

## Inspecting the Deployed Azure WebApp

Now that the entire process is complete, be sure to check out the fruits of your labor.

1.  Log into the [Azure Portal](https://portal.azure.com), navigate to the Azure WebApp you selected in the release pipeline as target and copy the URL as shown below.

![Finding the Azure App Service URL in the Azure portal](https://adamtheautomator.com/wp-content/uploads/2020/06/1-11-1024x204.png)

Finding the Azure App Service URL in the Azure portal

2\.  Now paste that URL into a browser by providing the URL of the Azure Web App. Your browser should now load the e-commerce sample application, similar to below home page

![The front page of the deployed application](https://adamtheautomator.com/wp-content/uploads/2020/06/2-15-990x1024.png)

The front page of the deployed application

You’ve now done it all! You now have an Azure web app deployed from a GitHub repo able to be automated to the fullest!

## Cleaning Up

If you followed along throughout this Project, you now have a new Azure DevOps organization, project, build pipeline, release pipeline and release. If you’re done testing things out, be sure to remove the original organization created so you don’t risk being charged for any Azure resources.

To do so:

1.  Go back to your main Azure DevOps workspace.
2.  Click on **Organization settings** in the lower left corner.
3.  On the Overview screen, click on the **Delete** button at the bottom of the page under **Delete organization**.
4.  Type the organization name and then click on **Delete**. This should remove all of the work you just performed.

## Your Takeaways

If you followed the instructions in this Project, you’ve created an entire CI/CD pipeline from scratch in Azure DevOps. You should now have a good idea of what this process entails.

Azure Pipelines can go _much_ deeper than what you did in this Project but you should now have some foundational knowledge of the entire process.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fazure-pipelines%2F&text=Build%20Your%20First%20Azure%20DevOps%20Pipeline%20from%20Scratch)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fazure-pipelines%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fazure-pipelines%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2020/04/jared-rice-O6DUoIl6NWA-unsplash.jpg)

### [Optimize ARM Output Variables in Azure DevOps Pipelines](/arm-output/)

Learn how to manage ARM output variables in Azure DevOps pipelines using PowerShell for efficient and streamlined workflows.

![](https://adamtheautomator.com/wp-content/uploads/2020/02/horses-1396651_1280.jpg)

### [Publish to Azure Artifacts NuGet Feed with Azure DevOps](/azure-devops-add-nuget-feed/)

Learn to package and publish Azure DevOps pipeline build artifacts to an Azure Artifacts NuGet feed. Enhance your IT skills and workflow.

![](https://adamtheautomator.com/wp-content/uploads/2020/02/cat-2934720_1280.jpg)

### [Build Azure DevOps Pipelines for PowerShell Modules](/azure-devops-powershell-module/)

Create an Azure DevOps pipeline for a PowerShell module and make modules first-class citizens. Enhance your automation skills and IT expertise.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
