Setup Azure CI/CD Pipelines Using Visual Studio - Part Two

Introduction 
 
In the previous article, we saw how to configure CI/CD for a single project solution. In this article, we will see how to configure CI/CD for multiple project solutions.
 
Before going forward, please go through the previous article.
 
I’m not going to spend time explaining Azure DevOps and its features, we are directly moving to CI/CD for multiple project solution. How can we configure this with the help of Visual Studio and TFS? We will see this step by step. Once we set up the Azure Pipeline, each check-in will build the application and deploy the changes on App Service according to the project.
 
To know about Azure DevOps and its other features, you can refer to the below blog.
Prerequisite
 
For configuring the Azure DevOps CI/CD, you need the following tools:
  1. Azure DevOps account
  2. Azure Portal Account
  3. Visual Studio 2012+(in my example I am using VS 2017 and 2019)
Steps
 
We will see how to configure CI/CD and setup Azure Pipeline using Azure DevOps.
 
Step 1
 
Create a new project by using the Azure DevOps account. I am using Team Foundation version control, but you can use Git too.
 
Create Project on Azure DevOps
Create Project on Azure DevOps
 
Step 2
 
Configure the newly created project in Visual Studio source control on your local system.
 
Configure Source Control 
Configure Source Control
 
Step 3
 
In the previous article, we created a new project with a solution in Visual Studio, now we are going to add another project under the same solution and add the changes.
 
Create a Project with name CICD_App2 
Create a Project with name CICD_App2
 
Added project in Solution control
Added project in Solution control
 
CICD_App2 Running Successfully
CICD_App2 Running Successfully
 
Step 4
 
Create a blank solution inside the CICD_App2 project folder.
 
Blank Solution
Blank Solution
 
Creating a Blank Solution
Creating a Blank Solution
 
Step 5
 
Add CICD_App2 Project in the newly created blank solution.
 
Adding Project
Adding Project
 
Select .csproj file in order to add a project in the solution 
Select .csproj file in order to add a project in the solution
 
Step 6
 
Setup Azure Pipelines under the publish settings of your solution.
 
Setup Azure Pipeline
Setup Azure Pipeline
 
Step 7
 
Wait for a few minutes, then go the pipelines under Azure DevOps. You will see a new Pipeline created. The build of the project has started.
 
DevOps Pipeline Created
DevOps Pipeline Created
 
Step 8
 
Check the Deployment Center on the Azure portal for your App Service, which you have set up the Azure Pipeline in step 6.
 
Azure App Deployment Center 
Azure App Deployment Center
 
Step 9
 
If there is no error in the build, then your build has succeeded. It should take a few minutes. In my example, it took up to 2 min.
 
Build Succeeded
Build Succeeded
 
Step 10
 
It will also create a release as shown in the previous article. In this article, I am going to show you how to create and configure a release manually.
 
Under the Releases, there is an option to create a new release.
 
New Release Pipeline 
New Release Pipeline
 
Step 11
 
Select a template (Azure App Service Deployment) for the stage and then add the Build Artifacts with a Continuous Deployment Trigger.
 
Template Selection 
Template Selection
 
Artifacts 
Artifacts
 
Continuous Deployment Trigger 
Continuous Deployment Trigger
 
Step 12
 
Create a task under the task option, then add the options correctly when you are creating a task.
 
Create Task
Create Task
 
Now, you are ready to create a release.
 
Creating Release Option 
Creating Release Option
 
Create Release 
Create Release
 
Step 13
 
After the release created it will start to deploy the changes on the App Service.
 
Released Successfully 
Released Successfully
 
Step 14
 
Check the App by using URL and you will see the application has deployed.
 
App Service URL after First Release 
App Service URL after First Release
 
Step 15
 
Change anything you need to in the application, check-in the changes, then Azure DevOps will build the solution and release the changes.
 
Heading change 
Heading change
 
After build completed, new changes are deployed
 
After the build is completed, the new changes are deployed.
 
Step 16
 
Now we are going to change the code in both projects and check-in those in the single check-in. Then we will see how both projects are built separately and deploy the changes in different app services accordingly.
 
Changes in Default.aspx pages under both project
 
Changes in the Default.aspx pages under both projects.
 
The build has started for both projects
 
The build has started for both projects
 
Released the changes of both projects
 
Released the changes of both projects
 
Changes have deployed
Changes have deployed
 
Note
 
We can see all Releases under Deployment Center on Azure Portal.
 
We need a separate .sln file to configure the CICD for each project.


Similar Articles