VSTS Project on Azure Web-app and VM

By September 26, 2019 October 7th, 2019 Azure, Blogs

Written by Karthik T, Principal Cloud Architect, Powerupcloud Technologies

This is a four-step process to create a VSTS project on Azure web-apps and VMs.

  1. Setup
  2. Code
  3. Build
  4. Release

1.Setup :

Steps for creating a VSTS project for hosting application on Azure Web-App and VM.

> VSTS ACCOUNT:

Sign Up for the account and create a new project. We used an agile process and Git version control.

If you want to know about the other project process available take a look at this link

> WEBHOST:

We are going to host a static webpage through Azure app services.

> WEB BROWSER:

VSTS is browser-based, so get your favourite modern browser.

> VIRTUAL MACHINE:

Create an Azure VM. OS of your choice.(Here we used Windows OS).

> VISUAL STUDIO:

Install Visual studio in your local machine from here.

> IMPORTING THE REPOSITORY:

There are a lot of ways we can import the repo. Here we used the “import a repository” option and use the git link to import the code to VSTS.

2.CODE:

Now the code will be pushed in your VSTS project.

Code will be pushed like this in the master branch

> BRANCH:

We can create multiple branches for each developer and keep permission for each branch for merging the code in the master branch.

> PULL REQUEST:

Once the developer writes his code in the new branch says ‘dev’, then he wants to push the code into the master branch for the build he uses the pull request option.

In the pull request, we can send the code for approval and review before merging the code into the master branch. We have created two branches and also committed a few lines in the code and merge it into the master branch.(optionally we can send for approval to review the code and merge it to their branch) and also we used Visual studio to commit/push/sync/fetch to VSTS Git repo.

3.BUILD :

We have created the private Git repository with an Agile process and committed the code in a git repo with the JSP sample app.

In continuous integration we have used maven task to build and to store the war file, we use publish artefact to store the war file.

we have used a maven task with the pom.xml file to build(optionally we can scheduled or trigger the build when the code is committed in repo).

In the triggers, tab enables the Continuous integration to automate the build process once the code is pushed in the master branch.

4.RELEASE:

We use publish artefact (war file) form the building part and for continuous deployment, we have created two pipelines

  • The store file in artefact is deployed to the Azure web app on apache tomcat and also added the load test task.
  • The store file in artefact is deployed to windows VM which is hosted on Azure.

> Release pipeline for Azure Webapp

From the build artefact, we are deploying to the release environment with two tasks that will host the JSP app.

Two tasks we used are Deploy Azure App service and quick web performance test

Once the release is successful we can check the logs how the tasks are done

> Release pipeline for Azure VM

We use the build artefact to deploy to Windows VM which is hosted in Azure.

The task we used here is Azure VMs file copy which will copy the artefact build file into Azure hosted VM.

VM credentials should be given “Azure file copy” task

Once the release is successful we can check the logs how the tasks are done

PROS AND CONS:

PROS

  1. Works with nearly every language and technology.
  2. VSTS includes project management tools like Agile, Scrum, CMMI.
  3. Because of its cloud-based, it’s very easy to access from anywhere.
  4. Users need not worry about server maintenance.

CONS

  1. It does not support integration with Sharepoint or Project server.

CONCLUSION:

The website was hosted successfully in Azure WebApp and Azure VM.

WebApp:

VM:

Hope the above was helpful. Happy to hear from you.

Leave a Reply