Use Jenkins and Azure DevOps to Deploy a Node.js App

1.5 hours
  • 4 Learning Objectives

About this Hands-on Lab

You have a Node.js application that you’d like to integrate using Jenkins. Instead of deploying to Azure from Jenkins though, you need to hand over the build artifacts to Azure DevOps to complete the deployment. Perform the necessary steps to create a CI process on the Jenkins server and the CD process in Azure DevOps.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an Azure DevOps Organization
  1. Log in to the Azure Portal using the provided credentials.
  2. Search for Azure DevOps from the services menu.
  3. Create a new organization and project named "MyFirstProject".
Set up Jenkins Server
  1. In the Azure Portal, go to virtual machines and copy the Public IP of the jenkins virtual machine.
  2. Paste the public IP in a new browser tab followed by :8080 (e.g., http://40.1.33.104:8080).
  3. Log in to the Jenkins server via SSH and copy the initialAdminPassword.
  4. Paste the password into the Jenkins installation wizard.
  5. Continue with installing Jenkins with the suggested plugins installed.
Create CI Build
  1. Create a new freestyle project.
  2. Fork this GitHub Repository: https://github.com/linuxacademy/content-az400-lab-resources.git
  3. Paste in your GitHub URL, run npm install, and archive the artifacts.
  4. Verify that the build was successful.
Create CD Pipeline
  1. Create a service connection for Azure Resource Manager using the provided service principal.
  2. Create a service connection for Jenkins and use the credentials you created during the Jenkins installation.
  3. Create a new release pipeline and deploy the artifact from Jenkins to the existing Azure WebApp.

Additional Resources

Start by logging into the Azure portal and searching for Azure DevOps from the Services menu. Proceed to create a new Azure DevOps organization and project named "MyFirstProject".

The Jenkins server has already been deployed, and you can access it from the virtual machine's public IP, on port 8080 (e.g., http://40.1.33.104:8080). Proceed to install Jenkins by first displaying the initial password and following the installation wizard. Once you've installed Jenkins, create a new freestyle project. Use Git for source code management SCM and fork the following repository: https://github.com/linuxacademy/content-az400-lab-resources.git

NOTE: You may need to install Node.js, npm, and zip on the Jenkins server. Use the following commands to install these packages:

sudo apt install -y nodejs
sudo apt install -y npm
sudo apt install -y zip

Once the appliciation has been packaged up, start a release in Azure DevOps. Ensure that you have created a service connection in Azure DevOps for Jenkins and Azure Resource Manager. Once you've deployed the application to the existing web application in Azure, you can consider this lab complete!

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?