Hi all, Hope you all are doing well!. I would like to talk about how to deploy ASP.NET Core CRUD API by use Azure CI/CD pipeline. So First I plan to show, how to how to deploy ASP.NET Core Web API by use Azure CI/CD pipeline.

Before all of this work, you should have installed Visual Studio 2019 Community with ASP.NET Core environment, install the Postman, create GitHub Account, Set up Git and Free Azure Account.

In this article, I will tell you,

  1. Create ASP.NET Core Web API
  2. What is CI/CD
  3. Deploy the API to AZURE

Let’s get started!

Image for post

Create ASP.NET Core Web API

Open the visual studio and create a new project and select ASP.NET CORE Web Application, and add the project name and then select “API” as the web application type, then create this application.

Now we created our ASP.NET Web API application and got the directory structure with these pre-created files for the Web API template. So you can see directory structure from below picture and There is a pre-created controller called WeatherForeacastController and one model class called WeatherForecast.

Image for post

Project Directory Structure

Now we can check it by use postman in the localhost server because it has created pre-created files. So you will get your API result as below picture.

Image for post

API Testing in localhost using postman

Before we deploy the API, we have to push this project files into GitHub. Because I use existing projects that trying to get it from GitHub to create the Azure CI/CD pipeline to deploy it.

Now we have to create a repository for this and push our commits to GitHub. Then we can use it for deploying the Web API to Azure.

Now we have to configure Azure CI/CD pipeline of deploy the ASP.NET Core Web API project.

What is CI/CD ?

Following definition from the InfoWorld.

Continuous integration (CI) and continuous delivery (CD) embody a culture, set of operating principles, and collection of practices that enable application development teams to deliver code changes more frequently and reliably. The implementation is also known as the CI/CD pipeline.

CI/CD is one of the best practices for DevOps teams to implement. It is also an agile methodology best practice, as it enables software development teams to focus on meeting business requirements, code quality, and security because deployment steps are automated.

Image for post

CI/CD helps teams to be more productive when shipping software with quality built in.

#aspdotnet #api #azure #devops

Create CI/CD Pipeline for ASP.NET Core Web API by using Azure DevOps Starter
20.05 GEEK