How to Build & Deploy a Java Web Application using Team Services and Azure

So, you’ve heard the tagline “Microsoft Loves Java” but the skeptic in you still has doubts. Well, it’s true! Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) are Microsoft developer toolkits to help developers plan, design, develop, test, deploy and support (the entire DevOps cycle) with all programming languages, including Java. We have Java focused products dating back over six years with our plug-in for Eclipse, Team Explorer Everywhere (TEE) and have had development teams focused on making the Java experience complete and fully featured for over 3 years turning out features as quickly as every 3 weeks. This blog will present various resources (blogs, videos, documentation) for build and deployment options available with VSTS and TFS when using Java and deploying to Azure.

Build and Deploy a Java App to Azure App Service

One of the primary sources of information for building with Java using Team Services and TFS is our dedicated Java subsite at java.visualstudio.com. On this site is a series of web pages that comprise an introductory walk-through of how to host your Java code for free in the VSTS Git service (which provides unlimited, free private Git repositories), build your Java web application using Maven, and then deploy your web application to Azure as a web app. This walk through can be found at the following URL:

http://java.visualstudio.com/Docs/gettingstarted/intro

Build and Deploy a Java App to an Azure Linux VM Running Tomcat

A second source of useful information on how to build and deploy using Java with VSTS and TFS are the many blog posts our teams publish for various scenarios. To track all our features, including blog post announcements and useful videos, follow our “News” page. One of our blogs shows how to setup an Ubuntu (there is a blog for setting up Red Hat too) Linux VM in Azure running Tomcat. The blog leads you through three different methods for deploying your Java web app to the VM: using Tomcat deploy, using SSH and using FTP. These three tasks are available within VSTS to assist you in easily deploying your applications:

https://blogs.msdn.microsoft.com/visualstudioalm/2016/08/18/deploying-an-azure-ubuntu-linux-vm-running-apache-tomcat-for-use-with-visual-studio-team-services-and-team-foundation-server/

Build Using Jenkins (integrated with Team Services) and Deploy to Azure

Many Java developers have used Jenkins as their primary build system and may have jobs configured on Jenkins for building and deploying their applications. VSTS has a Jenkins integration that essentially enables developers to use Jenkins as the build server (vs. using the built-in build support of VSTS) while still using VSTS for other features such as Git repo hosting, backlog management, sprint planning, testing and deployment. Our integration enables end-to-end traceability even when using Jenkins for builds with VSTS. There are two primary ways we support Jenkins. The first is via web hooks (aka service hooks) such that events (like pushing your Java code into a VSTS Git repo) trigger builds from VSTS to Jenkins. The second is using a VSTS build task to trigger remote Jenkins build jobs and provide real-time build output and feedback directly into the VSTS web interface. Using this build task approach enables the developer to also pull from Jenkins (once the build is complete) the artifacts (such as .war files) and test and code coverage files into the VSTS build system so that this information can be used in VSTS (artifacts can be deployed using our release management system and test and code coverage results can be displayed in VSTS build summaries). For more information on using Jenkins with VSTS, use the following resources:

Using the resources referenced in this blog, a developer can discover the benefits of using VSTS and TFS to build and deploy their Java applications to the Azure cloud. To stay up-to-date on exciting new features, subscribe to our blogs at the following URL:

https://blogs.msdn.microsoft.com/visualstudioalm/

0