Codementor Events

Using Continuous Integration With .Net Core and Azure Pipelines

Published Nov 08, 2018
Using Continuous Integration With .Net Core and Azure Pipelines

About me

Completely passionate for coding, all its features and complexity.

Professional with nearly 8 years of experience in the areas of software developing and programming in C# environment;
4 years of experience leading/managing IT projects;
Wide experience working with complex systems/web sites;

The problem I wanted to solve

In this article, I will be explaining more about continuous integration and how to apply it to your .NET Core projects using Azure Pipelines.

What is continuous integration?

Continuous Integration is a development practice that integrates the code into a shared repository each time a commit is pushed by any member of the development team. It makes an automated build and you may use tools to check your code, presenting problems as soon as they appear.
Why use continuous integration?

Quicker integrations
To have a solid repository
Use unit tests to validate your business rules
Catch problems as soon as they begin to be problems
Increase project status visibility
Make use of tools to check your code quality

What is Azure Pipelines?

"Azure Pipelines is a cloud service that you can use to build and test your code project automatically and make it available to other users. It works with just about any language or project type.
Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to constantly and consistently test and build your code and ship it to any target."

Why use Azure Pipelines?

Accepted languages: Python, Java, PHP, Ruby, C#, and Go.
Accepted application types: Java, JavaScript, Python, .NET, PHP, Go, XCode, and C++.
Integrates with: GitHub, Azure Repos, Bitbucket, and Subversion.
Accepted targets to deploy the code: container registries, virtual machines, Azure services, any on-premises or cloud target.
Type of packages produced: NuGet, npm, Maven packages or you can use any other package management repository of your choice.

How to apply continuous integration to your .NET Core projects using Azure Pipelines?

  1. I will use my previous project as a base project. You can find it here.

Project in Azure DevOps Repos.

  1. You need an Azure DevOps organization. If you don't have one, you can create one for free.

Using%20Azure%20Pipelines%20with%20ASP.NET%20Core01.png
Using%20Azure%20Pipelines%20with%20ASP.NET%20Core02.png

  1. Create a new project inside this organization.
    Using%20Azure%20Pipelines%20with%20ASP.NET%20Core03.png

  2. Have your code repository aligned
    Using%20Azure%20Pipelines%20with%20ASP.NET%20Core04.png

  3. Create the pipeline.
    Using%20Azure%20Pipelines%20with%20ASP.NET%20Core05.png

Select your GitHub repository here, but as we already uploaded our code in the Azure Repos, we are using the "Azure Repos" option.

Using%20Azure%20Pipelines%20with%20ASP.NET%20Core06.png

Now, we have the yml file. Push the "Run" button. (Nothing has to be edited here).

Using%20Azure%20Pipelines%20with%20ASP.NET%20Core08.png

It is going to execute the first build.
Using%20Azure%20Pipelines%20with%20ASP.NET%20Core09.png

Every commit pushed to the repository is going to integrate automatically and build the new merged code.

Using%20Azure%20Pipelines%20with%20ASP.NET%20Core10.png
Using%20Azure%20Pipelines%20with%20ASP.NET%20Core11.jpg

Using%20Azure%20Pipelines%20with%20ASP.NET%20Core12.png

Now we have successfully setted up our project with Azure Pipelines Continuous Integration

Discover and read more posts from Thiago Vivas de Araujo
get started
post commentsBe the first to share your opinion
Show more replies