Build Agents and Pools
Configuring API Access
The course is part of this learning path
Azure DevOps has many great tools for implementing and managing your build infrastructure, and this course walks you through how to use them. With a mix of theory and real-life demonstrations from the Azure portal, you will learn how to create Azure pipelines, use them to integrate 3rd party build systems, utilize agent pools, and learn how to put it all together to set up an automated workflow that can potentially save you hundreds of man-hours. So, whether you’re here to learn more about DevOps, improve your development process, or learn more about Azure DevOps in particular, this course will help get you further along your path.
For any feedback, queries, or suggestions relating to this course, please contact us at email@example.com.
- Learn how to build an Azure DevOps pipeline and add automation tasks
- Use the visual designer for adding build tasks to a pipeline
- Create a pipeline that closely matches an existing build process
- Determine a pipeline strategy based on the information given to you during a discovery process
This course is intended for:
- IT professionals looking to become certified DevOps professionals
- IT professionals experienced with other cloud providers who want to gain a better understanding of Azure
- Anyone who wants a better understanding of Azure build infrastructure processes
To get the most from this course, you should have some understanding of the software development process, at least at a high level, as well as an understanding of what DevOps is and the terminology related to it.
In this demo, we create our first Azure DevOps pipeline. Pipelines exist inside of a project and projects are part of an organization. So we're gonna create all three and connect our project with a code repository in GitHub. I have created a sample project you can use in GitHub, and we will discuss how you can use that in your own project in a few minutes.
The first thing we need to do is open our browser to dev.azure.com. Now, if you do not have an Azure DevOps account, you can click on the Start free button and create one or if you already have a GitHub account, you can click on the Start free with GitHub button and use your GitHub credentials to sign up for a DevOps account.
Once we have an Azure DevOps account, and we've signed in, we can click on the sign into Azure DevOps link, and it will take us to our organization page. You can have multiple organizations and here's where we're gonna create our new organization for our project.
We will click the new organization link here on the left-hand side, this will bring up the Getting Started with Azure DevOps dialog. At this point, Microsoft is indicating that if we continue past this point, we are accepting the terms of service for Azure DevOps. It also has a checkbox here if you want Microsoft to send you more information on Azure. So let's just go ahead and click the Continue button.
You will be asked to provide a name for your organization. Keep in mind here that your name must be unique across all of Azure DevOps. I'm just gonna use the one that they've provided for me here, this will be appended to dev.azure.com to form the access URL for your organization. We will also need to select the region where we'd like our organization to be hosted. So we will select a region and click Continue.
This brings us to the main page for our organization. This page has a form for creating your first project on the right-hand side. We're just going to enter a project name for our new project. I just wanna mention here again how private and public projects differ. If you choose a private project here, your code will be kept private, and no one will be able to see or contribute to your project, unless you expressly give them permission by adding them to your organization and to the project user group. Make sure you exercise caution here, if you're not sure, choose private, you can always make it public later. So in my case, I have a sample code repository set as public so that I can share it with you. So I'm gonna choose public.
At this point, let's talk briefly about the sample project in GitHub, I've created a GitHub repo at the following URL. This is a basic .net core solution with a main project and a test project. It is a basic MVC project template and the test project just has a couple of working unit tests. The goal with this project is not to show you how to write code, but it's just so that we have a code project for our pipeline to build. All you need to do at this point is go to the sample project at the URL I gave you and fork this project to your own GitHub account by clicking the fork button in the top right of the repository page.
Okay, now we have our organization, our DevOps project, and our .net core solution, we can now go ahead and create our new pipeline. On our project page, let's click our pipeline menu option. And since we do not already have a pipeline yet in our project, a page is gonna show up with a button on it for us to click to start configuring our first pipeline.
It's going to ask us where our code is, this is where we select our repository type provider. There are a few options here like the Bitbucket or Subversion. You can even select a generic git repository provider if you have your own on-premise git server. In our case, however, we're using GitHub, so let's just go ahead and click on the GitHub selection.
Now it will ask us to provide our GitHub credentials and sign in to GitHub. If you forked the sample repository to your own account, you should see your repo in this list, go ahead and click this repository.
Although not shown here in the demo, this action will likely bring you to a repository authorization page for your code repo. And it's gonna ask you to give Azure DevOps access to the selected repos, you can go ahead and grant access for the Select repos and this will bring you back to the Azure DevOps page. And it will now ask us what type of pipeline we'd like to configure.
As you can see, there are a ton of choices here, from .net core, Node.js, you can configure for Android, you can even use XCode workspaces where you can build and test MacOS applications. There's something here for everyone and this list will continue to grow as Microsoft adds to its service offerings for Azure DevOps.
Since our solution is a .net core project, we will choose the .net core for our pipeline. This will create an initial pipeline with a few initial tasks. These are tasks that are common to most .net core solutions.
Now that our initial pipeline is created, what you're looking at here is YAML. It's the configuration language that Azure DevOps uses to configure the task that you will run whenever you commit changes in your software project to your GitHub repo.
So we have our initial pipeline configured, let's save and run it and see what happens. Clicking Save and run it will ask us if we wanna commit our new YAML file to the master branch, or if we'd like to create a new branch. This means that our pipeline build configuration is also stored in our code repository, and we're able to track changes to this file, just like any other code file in our project.
It will just take a minute or two to create the pipelines. So I'll speed up the time here and then we'll click into the jobs and see it as it runs.
While our job is running, I'll explain what is happening in our basic pipeline. First, it initializes the job. If we have a look at the job initialization task, we see that it's using a hosted agent. This is a build agent that is supplied by Microsoft to run our build tasks. In the module on build agents, we will look at what a build agent is in a bit more depth, and have a look at the differences between private and hosted agents like this one. Then the job is gonna download all of our tasks to the agent machine, it's going to check out our code from our code repository. After that, it will install our NuGet package manager, then it restores all of our NuGet packages, builds our project and runs our unit tests. It then cleans up after itself by removing the repository credentials and tearing down the virtual machine that the build agent is using. This is an important step. We don't want our code out on a shared agent machine. Finally, if we have any reporting tools configured for our tests, it will generate the tests or code coverage reports and drop them into our artifacts section.
Now at the time of this recording, the initial unit testing tasks that's created on the default pipeline doesn't actually run your unit tests. Microsoft is in the process of making updates to Azure DevOps and there's a known issue with this particular task. This task is trying to use an older version of MSBuild, and unfortunately, it cannot actually find the test in your project. When we look at YAML in a later module, I'm gonna show you how we're gonna change this task to use the updated .net core command line build tools to run our unit tests.
Okay, there you have it, we've built our first Azure DevOps pipeline. Now we have it, what can we do with it? Well, you're in luck, I'm gonna show you some additional things we can do with it in the next few modules.
About the Author
As well being the owner and CTO of Sharp Solutions Group, a software development and IT staffing company based in the Philippines, Kelso is a Microsoft Certified professional and an avid knowledge seeker. His belief is that you need to learn something new each day to stay on top of the constantly changing IT world. He is an avid gamer (both video games and board games) and lives in the Philippines with his wife and soon-to-be-delivered son.