Email: Password:       Forgot Password 
    .netCodeSG
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
 
TECHNOLOGIES:
 

Hands On Azure DevOps CI and CD Step by Step

Article:
Viewed:  73 
Posted On:  21/07/2019 16:23:34 
Learn Azure DevOps CI/CD step by step 

 

In this article, I am going to show how we can do Azure DevOps CI/CD Step by Step.

Steps Involved in this article are listed below:

Step 1: Create your Visual Studio Solution.

Step 2: Check in your code in a code repository (I am going to use Git here. https://github.com)

Step 3: Create an Organization -> Project in your Azure DevOps account (https://dev.azure.com)

Step 4: Create Pipeline (Build & Release) in you Azure DevOps Project.

Step 5: Add Stages (Dev/QA/Prod) in your Release Pipeline.

Step 6: Make changes in your code and do check in (Push) -> and check CI/CD is working fine.

Now we will learn all steps in detail.

Step 1: Keep ready your Visual Studio solution. In my case I am going to create a Sample ASP.NET core application. Where Index.cshtml, I am showing some static text.

My HomeController(Index.cshtml output is):

1.png

Image 1.

Step 2: Push your code in Git Repository (You can use any code repository)

Login: https://github.com/

2.png

Image 2.

Create a New Code repository.

3.png

Image 3.

4.png

Image 4.

Now Time to add your code to Git Newly created Repository.

Go to your Visual Studio Solution => Code Containing Folder:

5.png

Image 5.

6.png

Image 6.

7.png

Image 7.

 

echo "# TestDemo" >> README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/...../TestDemo.git

git push -u origin master

8.png

Image 8.

 

Step 3: Login https://dev.azure.com

Here create a New Organization:

9.png

Image 9.

10.png

Image 10.

Click on Continue.

11.png

Image 11.

Now time to create a New Project under your Organization. For this click on  +Create Project

12.png

Image 12.

13.png

Image 13.

Click on Create. Your Dev.Azure.com account will look like below:

14.png

Image 14.

Once your project is ready, you will redirect to below window.

15.png

Image 15.

16.png

Image 16.

Here under Pipelines -> Build -> New Pipeline.

17.png

Image 17.

Here click on "Use the Classic Editor"

18.png

Image 18.

Here We need to select our code repository. As we have our code in GitHub so select GitHub here and Authorize using OAuth here.

After Authorizing, Select your Code Repository and branch like below:

19.png

Image 19.

20.png

Image 20.

21.png

Image 21.

22.png

Image 22.

23.png

Image 23.

24.png

Image 24.

25.png

Image 25.

26.png

Image 26.

27.png

Image 27.

28.png

Image 28.

29.png

Image 29.

30.png

Image 30.

Now check your build pipeline. It will look like below:

31.png

Image 31.

Our Build Pipeline is ready. Now time is to create Release Pipeline. Therefore, as per our application requirement we have a Web Application. So we will deploy this application into 3 different environments ie: Dev, QA and PROD.

Before creating Release pipeline, we will create 3 Web Application as below from Azure Portal:

32.png

Image 32

Now time to create Release Pipeline:

Go to  https://dev.azure.com/amster777/DevOpsDemo => Pipeline => Release

33.png

Image 33.

By clicking on New Pipeline below window will open.

34.png

Image 34.

Here search Azure App Service Deployment and Apply.

Give a name to your stage.

35.png

Image 35.

Now add an Artifact in your release pipeline.

36.png

Image 36.

Here select your  Project, Source, Default Version and Source Alias.

37.png

Image 37.

From below screen option, Enable Continuous Deployment.

38.png

Image 38.

Now Click to '1 Job, 1 Task' in DEV stage for configuring the DEV environment so that if a new build is there it auto deploys on the DEV environment.

39.png

Image 39.

Select above setting and leave rest of the all as default.

Now add QA and Prod Stages as well.

40.png

Image 40.

41.png

Image 41.

You can add Pre or Post deployment approval.

42.png

Image 42.

Now time to trigger First release.

43.png

Image 43.

44.png

Image 44.

Release Succeeded for DEV & QA and waiting approval for PROD.

45.png

Image 45.

Now check your DEV and QA environment.

46.png

Image 46.

Now Make some changes in your code and do commit your code:

47.png

Image 47.

Once commit done, Automatic build and release pipeline will trigger.

  Comment:
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us