In this article, we'll use Azure to create a java web app for free. If you don't have an Azure subscription Please create a Free Account before you start.
** [Azure] I tried to create a Java application for free-Web App creation- [Beginner] **: point_left_tone1: Now here: bangbang: -Create a "java" web app using "App Service" ・ Display up to "Hello world !!" on the TOP page
[Azure] I tried to create a Java application for free-Connect by FTP- [Beginner] -Connect to the previously created "java" web application by FTP ・ Change "Hello world !!" on the TOP page
~ Schedule for the next time and later ~ [Azure] I tried to create a Java application for free ~ Git edition ~ [Beginner] [Azure] I tried to create a Java application for free ~ SQL Server ~ [Beginner]
-Open Portal in your browser
-Select "Add" in "Home> App Service"
・ Enter and select items.
・ If there are no mistakes in the content, select "Confirm and create"
· Move to resource when deployment is complete
-Click the URL displayed as "https: //
-Click Quickstart displayed on the created site.
Work on the official document "Quick Start> Create Java App" as follows. [Official] Creating Java Web Apps on Linux-Azure App Service | Microsoft Docs
* It may be changed to the official document, so please be aware of it with assistance! </ font>
-Start Cloud Shell. (On Portal -1.amazonaws.com/0/197404/8ddf185d-b69c-1052-ab81-4a395ab38056.png) so open it)
Run the following Maven command at the Cloud Shell prompt to create a new app named helloworld
bash
//Check that the helloworld directory exists
//(If it exists, an error will occur with mvn archetype)
ls -a
//Create a new app
mvn archetype:generate -DgroupId=example.demo -DartifactId=helloworld -DarchetypeArtifactId=maven-archetype-webapp
//Check if helloworld is created
ls -a
Open the project pom.xml file in the helloworld directory.
bash
// 'helloworld'Transition to directory
cd helloworld
// pom.Open xml file
code pom.xml
Next, add the following plugin definition inside the
element of the pom.xml
file.
pom.xml
<plugins>
<!--*************************************************-->
<!-- Deploy to Tomcat in App Service Linux -->
<!--*************************************************-->
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.7.0</version>
</plugin>
</plugins>
Next, configure the deployment and at Command Prompt Execute the maven command
mvn azure-webapp: config
and Confirm (Y / N) (Confirm (Y / N)) Until the prompt is displayed Press Enter to use the default configuration and pressy
to complete the configuration.
bash
mvn azure-webapp:config
//The following is displayed
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< example.demo:helloworld >-----------------------
[INFO] Building helloworld Maven Webapp 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- azure-webapp-maven-plugin:1.7.0:config (default-cli) @ helloworld ---
[WARNING] The plugin may not work if you change the os of an existing webapp.
Define value for OS(Default: Linux):
1. linux [*]
2. windows
3. docker
Enter index to use:
Define value for javaVersion(Default: jre8):
1. jre8 [*]
2. java11
Enter index to use:
Define value for runtimeStack(Default: TOMCAT 8.5):
1. TOMCAT 9.0
2. jre8
3. TOMCAT 8.5 [*]
4. WILDFLY 14
Enter index to use:
Please confirm webapp properties
AppName : helloworld-1558400876966
ResourceGroup : helloworld-1558400876966-rg
Region : westeurope
PricingTier : Premium_P1V2
OS : Linux
RuntimeStack : TOMCAT 8.5-jre8
Deploy to slot : false
Confirm (Y/N)? : Y
Go to pom.xml again and verify that the plugin configuration has been updated. If desired, you can modify other App Service configurations directly in the pom file. Here are some common ones:
<pricing Tier>
<appName>
<resourceGroup>
Please check! !! !!bash
code pom.xml
Deploy your Java app to Azure using the following command:
bash
mvn package azure-webapp:deploy
After the deployment is complete, browse to the deployed application using the following URL in your web browser:
If "Hello World!" Is displayed on "https: //
**! !! !! Completed! !! !! ** **
-[Azure] I tried to create a Java application for free-Web App creation- [Beginner] -[Azure] I tried to create a Java application for free ~ Connect with FTP ~ [Beginner] -[Azure] I tried to create a Java application for free ~ Git edition ~ [Beginner] -[Azure] I tried to create a Java application for free ~ SQL Server ~ [Beginner]
[Official] Creating Java Web Apps on Linux-Azure App Service | Microsoft Docs
Recommended Posts