Create a Hello World web app for Azure using IntelliJ
This tutorial shows how to create and deploy a basic Hello World application to Azure as a web app by using the Azure Toolkit for IntelliJ.
For a version of this article that uses the Azure Toolkit for Eclipse, see Create a Hello World web app for Azure using Eclipse.
The Azure Toolkit for IntelliJ was updated in August 2017 with a different workflow. This article illustrates creating a Hello World web app by using version 3.0.7 (or later) of the Azure Toolkit for IntelliJ. If you are using the version 3.0.6 (or earlier) of the toolkit, you will need to follow the steps in Create a Hello World web app for Azure in IntelliJ using the legacy toolkit.
When you have completed this tutorial, your application will look similar to the following illustration when you view it in a web browser:
To complete the steps in his article, you will need to install the Azure Toolkit for IntelliJ, which requires the following software components:
IntelliJ IDEA Ultimate Edition or Community Edition, which can be downloaded from the JetBrains website.
A supported Java Development Kit (JDK). For more information about the JDKs available for use when developing on Azure, see https://aka.ms/azure-jdks.
An operating system. The Azure Toolkit for IntelliJ has been tested on the following operating systems:
The Azure Toolkit for IntelliJ page at the JetBrains Plugin Repository lists the builds that are compatible with the toolkit.
Create a new web app project
Start IntelliJ, and sign into your Azure account by using the instructions in the Azure Sign In Instructions for the Azure Toolkit for IntelliJ article.
Click the File menu, then click New, and then click Project.
In the New Project dialog box, select Maven, then maven-archetype-webapp, and then click Next.
Specify the GroupId and ArtifactId for your web app, and then click Next.
Customize any Maven settings or accept the defaults, and then click Next.
Specify your project name and location, and then click Finish.
Within IntelliJ's Project Explorer view, expand src, then main, then webapp, and then double-click index.jsp.
When your index.jsp file opens in IntelliJ, add in text to dynamically display Hello World! within the existing
<body>element. Your updated
<body>content should resemble the following example:
<body><b><% out.println("Hello World!"); %></b></body>
Deploy your web app to Azure
Within IntelliJ's Project Explorer view, right-click your project, choose Azure, and then choose Run on Web App.
In the Run on Web App dialog box, you can choose one of the following options:
Choose an existing web app (if one exists), and then click Run.
Click Create New Web App. If you choose to create a new web app, specify the requisite information for your web app, and then click Run.
The toolkit will display a status message when it has successfully deployed your web app, which will also display the URL of your deployed web app.
You can browse to your web app using the link provided in the status message.
After you have published your web app, your settings will be saved as the default, and you can run your application on Azure by clicking the green arrow icon on the toolbar. You can modify your settings by clicking the drop-down menu for your web app and click Edit Configurations.
When the Run/Debug Configurations dialog box is displayed, you can modify any of the default settings, and then click OK.
For more information about the Azure Toolkit for IntelliJ IDEA, see the following links:
- Azure Toolkit for IntelliJ
- Release Notes
- Installing the Azure Toolkit for IntelliJ
- Create a Hello World web app for Azure in IntelliJ
- Sign-in instructions for the Azure Toolkit for IntelliJ
For more information about using Java with Azure, see the following links:
- Azure for Java Developers
- Java Tools for Visual Studio Team Services
- Get Java JDK downloads and support when developing for Azure
For additional information about creating Azure Web Apps, see the Web Apps Overview.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.