Azure DevOps pipeline sample .NET project for CI/CD

Setting up an Azure DevOps pipeline is great for .NET projects, as we can setup continuous integration (CI) and continuous deployment (CD) in Azure.

This is the ASP.NET Core Web API project that is used in our Azure DevOps pipeline tutorial if you wish to follow it along at home.

It's also the same project that is used with our video.

Software

This is the software that will need to be installed onto your machine.

  • Visual Studio 2022 17.0.5 or above. It will work with the free community version. Please note, this project will not work with VS 2019.
  • .NET 6.0 SDK 6.0.101 or above. Visual Studio 2022 should already have the .NET 6 SDK installed.

Get the application working

These are the steps to get the application working.

  • Fill out the sample code form. We will send you an email to the GitHub repository where you can download the sample.

You are now ready to go.

Open the solution in Visual Studio

If you wish to look at the solution, open up RoundTheCode.AzureTestProject.sln in Visual Studio 2022.

Start the project in Visual Studio.

The application will run on https://localhost:9001. Navigating to that link will display the Swagger documentation. There is one API endpoint that can be ran.

There are also unit tests provided with the solution if you wish to run them.

Source control hosting

With Azure DevOps, you'll have to host the code with your own source control hosting service. You can do that by either forking the repo into your own GitHub account, or pushing the repo to another source control hosting service, like BitBucket.

From there, you will need to give your Azure DevOps account authorisation to your source control hosting service so it is able to access the repo.

Build pipeline YAML file

The build pipeline YAML file (saved as azure-pipelines.yml) is available in the repo's root.

As there is already a azure-pipelines.yml file in the repo, it will automatically pick this file up when creating your first pipeline in Azure Pipelines. If you wish to create the YAML file from scratch, you will need to delete this file from your repo.

Free .NET coding videos

  • .NET 6 new features using ASP.NET Core and Visual Studio 2022
  • C# 10: New features
  • Blazor updates for .NET 6
Watch .NET videos