Loading...

Azure Tips and Tricks - Build and deploy your first app with the Azure SDK for Java on Azure

Azure Tips and Tricks - Build and deploy your first app with the Azure SDK for Java on Azure

Build and deploy your first app with the Azure SDK for Java on Azure

 

Azure is a very inclusive cloud platform. You can run applications on it that have been created in almost any programming language. This includes Java. And Microsoft has even created an Azure Toolkit for Eclipse to make it easier to use Azure when you are developing Java applications. Let's see how that works. In this post, we'll create a simple Java application and run that in an Azure App Service Web App.

 

Getting your development environment ready

 

Before we get started, we need to make sure that we can develop Java applications on our development machine and that we have the Azure toolkit for Eclipse installed. Follow the steps below to get your development environment ready.

  1. Download and install the latest Java Development Kit
  2. I'm sure you have eclipse installed already but for those new to Java it can be found here. (Eclipse IDE for Java EE Developers).

Installing the Eclipse IDE for Java EE DevelopersInstalling the Eclipse IDE for Java EE Developers

  1. Install the Azure Toolkit for Eclipse

That's it! you're now ready to develop a Java application and run it in Azure.

 

Create a Java application and run it on Azure

 

Now that our development environment is ready, we'll create a Java application and see if it rus locally. We'll create a Dynamic Web Project, (if you are not familiar with Java, this is a dynamic web application).

  1. Open Eclipse
  2. In Eclipse, click File > New > Dynamic Web Project

Create a new Dynamic Web ProjectCreate a new Dynamic Web Project

  1. Fill in a Name and click Finish to create the project
  2. In the Project Explorer, expand your project and right-click WebContent
  3. Now select New > JSP File
  4. In the New JSP File window, name the file index.jsp and click Finish to create a new Java Server Pages file
  5. In the .jsp file, put the following line in the body tags and save the file

 

 

<% out.println("Hello world!"); %>

 

 

  1. In the Project Explorer, right-click on the project and select Azure > Publish as Azure Web App

The publish to Azure menu in EclipseThe publish to Azure menu in Eclipse

  1. Choose interactive for the authentication method and click Sign in
    1. You're now prompted to log in. Use you Azure credentials to log in
  2. After you've logged in, you can create a new Web App by clicking Create

Create an Azure App Service Web App in EclipseCreate an Azure App Service Web App in Eclipse

  1. Fill in a Name for the Web App
  2. Use an existing App Service Plan or create a new one
  3. In the Resource Group tab, select an existing Resource Group or create a new one
  4. Check the settings in the Java tab to make sure that you're happy with them (usually, the latest version is fine, but it depends on your specific needs)
  5. When you are ready, click Create to create the Web App
  6. The Web App is now available in the deployment window. Select the Web App and click Deploy to start publishing the application to the Web App

Create an Azure App Service Web App in EclipseCreate an Azure App Service Web App in Eclipse

  1. Once the deployment is done, navigate to the Azure portal and find the Web App that you've just created
  2. In the overview blade of the Web App, you'll find the URL of the Web App. Click on the URL

Web App URL in Azure portalWeb App URL in Azure portal

  1. The application will now load and will show the text: Hello world!. Congratulations, you are running a Java application on Azure!

Today we deployed a simple app but few are aware of all the Azure integration with eclipse and Java.

 

Conclusion

 

Java is just one of the programming languages that is supported on Azure. This makes Azure a very inclusive cloud platform that welcomes applications from almost any platform. And for most programming languages, there is an SDK and development tools available to help you out. 

 

Create a trial account today and go and check it out!

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.