Here is the link to the "home page" for this blog series.

To get started with Azure DevOps create an account as I described here. I am going to use my public Azure DevOps project here.

First we are creating a build pipeline. Go to your Azure DevOps project and click on Pipelines then click on Build

Build pipeline

Click on New pipeline

Source Control

Choose Use the visual designer

Choose your source control, in our case we choose Azure Repos Git, simply because we are using Azure DevOps for source control and MyVeryFirstAPI repo we created in this blog and click on Continue.

Our application is .NET Core application and we choose .NET Core template. Just start writing in the search boxen Core

ASP .NET Core template

Choose ASP .NET Core template and click on Apply.

ASP .NET Core Build pipeline

Provide a meaningful name and choose Hosted VS2017 Agent pool. Click on Save & queue.

Click on Save & queue -> Save & queue.

Save build pipeline and queue

Just click on Save & queue button.

Now we triggered the build with version #20190320.1

Build has been queued

When we click on the blue version, we can see how Azure DevOps running our build definition and all logs

You can see here all the logs when steps we defined in the ASP .NET Core build pipeline were executed. And actually som other kind of help steps Azure DevOps executes.

When the build is finished we see the following

Build Summary

All tasks executed successful, except one Publish. Let's take a look at the error message

##[section]Starting: Publish
Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports and authenticated feeds like Package Management and MyGet.
Version      : 2.148.1
Author       : Microsoft Corporation
Help         : [More Information](
[command]C:\windows\system32\ 65001
Active code page: 65001
##[error]No web project was found in the repository. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory.
##[error]Project file(s) matching the specified pattern were not found.
##[section]Finishing: Publish

Azure DevOps could not find wwwroot folder or web.config. And it is true because ASP .NET Core template generates a folder called wwwroot but it's empty and git just ignore all empty folders. The easiest fix is go to your build definition and click on Publish task

Publish definition

By default ASP .NET Core template assume that you want to build a web application but we can just remove Publish Web Projects because we are creating an API.

It should looks like this

Correct Publish definition 

Save and queue again.

Successful Build

Now we are finished with CI for our API. You can take a look at Artifacts folder. Click on it and explore

Artifacts explorer

This is output of your build. Very important for error seeking when something is wrong and behaves strange.

You see also that we get one warning when executed Test task. It's because we didn't created any tests yet. We can ignore the warning or deactivate Test task.

Right click on Test task and choose Disable selected task(s).

It's very good excise to use the visual designer and understand how all these tasks work but it is much better to user YAML file to define all this graphical tasks.

This blog post explains how to do the same what we did here but with YAML file.

Here is the link to the "home page" for this blog series.

Let me know in the comments if you experienced any troubles or if you have any feedbacks. Don't forget to subscribe to get news from Sergey .NET directly to your mailbox.

Create Azure DevOps account

My public Azure DevOps project DotNetCore

Create first .NET Core API

Continuous Integration(CI) using Azure DevOps Pipelines and YAML