Open In App

Microsoft Azure – Build and Deploy App with Azure SDK For Java

Last Updated : 30 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will learn how to build and deploy our first app with the Azure SDK for Java. We can run almost any type of application in Azure including Java applications. The Azure SDKs are collections of libraries built to make it easier to use Azure services from your language of choice. These libraries are designed to be consistent, approachable, diagnosable, dependable, and idiomatic.

 

Implementation:

Let’s create one and run it in Azure. Before we can start, we need to install a couple of things. 

Step 1: The first thing to install is the Java software development kit which we can get from the given URL. Installing it is very straightforward, and it doesn’t require any special settings. 

 

 

Step 2: We also need the Eclipse development environments to create our application. We can get that from the URL, and it is completely free to use just like Visual Studio Code and Visual Studio Community Edition. 

 

 

Step 3: For the application that we will create, we will need the Eclipse IDE for Java Developers. The rest of the installation is very straightforward.

 

Step 4: Here, we are in the eclipse, we need to install the last piece of the puzzle, the Azure SDK for Java. We can get that from the help menu by installing new software, and we need the URL to get the SDK. There are more Azure tools available, but for now, we only need this one.

 

These will be the ones that we want and accept the license agreements. 

Step 5: Now, create a new dynamic web project. This is a Java server pages project, and give it a name.

 

Step 6: Now, add a new JSP or Java Server Pages file. Let’s call it index. jsp. That makes this file the page that opens by default when we open the website later on. It is a simple HTML file with some Java magic in it. 

 

Step 7: Here in the body, print Hello World, and that’s it. 

 

Step 8: Now, publish the app to Azure. we can do that by right-clicking on the project and choosing Azure, publishing as an Azure web app. 

 

Step 9: Now, follow the wizard. First, wewew need to sign in to our Azure subscription.

 

Step 10: Now, create a new web app. Leave the name as-is and obtain the location to something closer.It will also create a new resource group which is fine, and it will run the app on Java 8 on a Tomcat server in the web app.

 

Step 11:  The URL to the website will be this one. Deploy it. It will now deploy the app to Azure. 

 

Step 12: Here we are in the Azure portal, and this is the web app that we have just created from Eclipse, and deploying our application to. It runs in a new resource group in Central US. Let’s see if it works. A simple page with hello world on it. 

 

It is very simple to publish a Java application to Azure from Eclipse with the Azure SDK. Azure is truly a place where every type of application is welcome.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads