Building Infrastructure with Azure Pipelines

1.25 hours
  • 4 Learning Objectives

About this Hands-on Lab

You have been given an ARM template for a Linux VM to deploy to Azure. Using Azure DevOps, you must check the ARM template for errors (linting), and deploy the VM to the provided Azure environment.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an Azure DevOps Organization
  1. Login to the Azure Portal using the provided credentials.
  2. Search for "Azure DevOps" from the services menu.
  3. Create a new organization and project named MyFirstProject.
Push Code to Azure Repos
  1. Login to the Linux VM provided with this lab.
  2. Use the following command to clone the node-express branch of the repository:
    git clone -b arm https://github.com/linuxacademy/content-az400-lab-resources.git
  3. Remove the GitHub origin with the following command:
    git remote remove origin

    1. Copy the commands from Azure Repos to add the new remote origin and push the code.
Create the Build Pipeline
  1. Create a new Azure Build Pipeline in the classic editor.
  2. Add the appropriate tasks to install jsonlint on your build agent.
  3. Run jsonlint and specify the template.json file.
  4. Fix any JSON errors.
  5. Copy and publish the file to the build artifact staging directory.
Create the Release Pipeline
  1. Create a new release pipeline in Azure DevOps.
  2. Use the artifact created in the previous objective.
  3. Create the necessary task to deploy the arm template.
  4. Make sure to create a service connection using the service principal provided.
  5. Ensure that the service connection is used within the release pipeline task.

Additional Resources

Start by logging into the Azure portal and searching for Azure DevOps from the services menu. Proceed to create a new Azure DevOps organization and project named MyFirstProject. SSH into the Linux VM with this lab to clone the arm branch of the repository using this command: git clone -b arm https://github.com/linuxacademy/content-az400-lab-resources.git

Once the code is in Azure Repos, create build pipeline, checking the ARM template for JSON errors. Proceed to add it to the artifact staging directory, so the release pipeline can use it. Once you have a successful build, create a new release pipeline, deploying the ARM template to the given Azure environment. HINT: Make sure that you use the provided service principal to create a service connection

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?