Introduction
This article series will explain using Jenkins for CI and CD of an ASP.NET Core web application on the local development environment. It also shows publishing the web application to Azure Web App Service and configuring Jenkins on Azure for continuous integration and continuous deployment of the hosted application. GitHub will DevOps as a source control repository. We’ll create a pipeline using Jenkins that fetches the code from GitHub, builds the code, runs the tests and deploy the package. This will be a repetitive task on each commit to the code located on GitHub.
In the first article of the series, we learned about the concepts, terminology, technologies involved, installing Jenkins, creating ASP.NET Core application and continuous integration of Asp.NET Core application using Jenkins via two approaches i.e. pipeline approach and freestyle project approach. In this article, we’ll publish the ASP.Net core application to Azure App Service and Configure Jenkins on Azure before we move on to the next steps.
Roadmap
Following is the roadmap we will be using to completely learn end to end development and configurations of Continuous Integration and Deployment (CI/CD) of Asp.Net Core Application on Azure Web App using Jenkins.
- Day 1: Continuous Integration of ASP.NET Core application using Jenkins.
- Day 2: Publish the ASP.Net core application to Azure App Service and Configure Jenkins on Azure.
- Day 3: Integrate Jenkins with Azure Active Directory and Service Principal.
- Day 4: CI/CD of ASP.NET Core application on Azure using Jenkins Azure Pipeline.
Prerequisites
Go through the first article of the series before starting this article.
The following are the prerequisites for the developers to have on their machine before getting started:
- Visual Studio 2017/2019.
- Dotnet 2.1 SDK installed.
- Azure Subscription Free/Paid.
- Java 1.5 or higher.
- Git account
- Git for Windows
Publish ASP.NET Core Application to Azure App Service
We configured and tested Jenkins locally. It is now time to publish our web application to Azure using the Azure Web App service and configure Jenkins there for continuous integration and deployment.
The role of Jenkins will be to fetch the code from GitHub on Azure, compile it and if successfully compiled, publish the changes to the deployed website. For this to happen, the application already needs to be provisioned on the Azure App Service.
Let’s first deploy the application to Azure and get it running on a public URL.
- Open the application’s solution file in Visual Studio. Right-click the Web project and click on Publish.

- On the next screen, select “App Service” and select the “Create New” option. Click on Publish.

- When you click on Publish, you’ll be asked to create an app service. Provide the required fields as shown in the following image.

- App Name: Name of the application. You can give any name of your choice.
- Subscription: Select the Azure subscription you own.
- Resource Group: You can use an existing resource group or create a new one. I have created a new one and named it JenkinsIntegrationRSG.
- Hosting Plan: Create a new hosting plan here, give it a name. In this case, it is JenkinsIntegrationHP, give it a location and since we are using it for a sample application, choose “Free” in the size. Click on OK.
Once all the details are provided, click on “Create”. It will take some time to create the app service and deploy the application to that app service.
- Once deployed, you get the URL of the deployed application opened in the browser. As we see here, the application is deployed on Azure and has a public URL the hostname we see here comes from the hosting machine on Azure.

- Verify the same on Azure Portal. Login to your Azure Portal and you can find the new resource created on the Dashboard with the name of the App Service that was provided while creating the app service from Visual Studio. Navigate to that resource on the portal to check the resource group and URL. A resource group is the same we provided while publishing.

Configuring Jenkins on Azure
We’ll configure Jenkins server on Azure and integrate our application to the CI and CD.
Before you proceed, uninstall the Jenkins that is installed on your local machine and delete the Jenkins folder created on your Program Files.
Create Jenkins Server on Azure
We installed and made Jenkins run on a local development machine. Let’s see how we can configure it on Azure.
- On the Azure Portal, create a new resource and in the search options, search for Jenkins as shown below:

- The Jenkins resource loads up from Azure Marketplace, click on Create to deploy a new Jenkins server on Azure.


















Bikesh SrivastavaPosted Dec 16, 2019, 6:27 AM
Well explained
Hamid KhanPosted Dec 10, 2019, 3:47 AM
Very nice and good explanation >>>>>>>>>>
Rushi MehtaPosted Dec 6, 2019, 1:08 AM
Nice article
Sourav Kumar DasPosted Dec 5, 2019, 1:03 AM
Nice article Sir.