- Home
- .NET code examples
- Azure DevOps pipeline example .NET project for CI/CD
Azure DevOps pipeline example .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.
C# coding challenges
This is the ASP.NET Core Web API project that is used in our Azure DevOps build pipeline and Azure DevOps release pipeline if you wish to follow it along at home.
It's also the same project that is used with our pipeline videos.
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 code example 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.
Pipeline YAML files
The build pipeline YAML file (saved as azure-pipelines.yml
), and the release pipeline YAML file (saved as azure-pipelines-1.yml
), are available in the repo's root.
As there is already a azure-pipelines.yml
and azure-pipelines-1.yml
files in the repo, it will automatically pick these files up when creating your first pipeline in Azure Pipelines. If you wish to create the YAML file from scratch, you will need to delete these files from your repo.