Skip to content

Commit e9dfad1

Browse files
authored
Merge pull request #301158 from v-thepet/app6
Freshness: Azure App Service 6
2 parents 9decade + e01f169 commit e9dfad1

7 files changed

+355
-347
lines changed

articles/app-service/includes/quickstart-java/quickstart-java-javase.md

Lines changed: 182 additions & 170 deletions
Large diffs are not rendered by default.

articles/app-service/includes/quickstart-java/quickstart-java-jboss.md

Lines changed: 85 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,90 +3,97 @@ author: cephalin
33
ms.service: azure-app-service
44
ms.devlang: java
55
ms.topic: include
6-
ms.date: 04/23/2025
6+
ms.date: 06/10/2025
77
ms.author: cephalin
88
---
99

10-
In this quickstart, you'll use the [Maven Plugin for Azure App Service Web Apps](https://github.com/microsoft/azure-maven-plugins/blob/develop/azure-webapp-maven-plugin/README.md) to deploy a Java web application to a Linux JBoss EAP server in [Azure App Service](/azure/app-service/). App Service provides a highly scalable, self-patching web app hosting service. Use the tabs to switch between Tomcat, JBoss, or embedded server (Java SE) instructions.
10+
[Azure App Service](/azure/app-service/) provides a highly scalable, self-patching web app hosting service. In this quickstart, you use the [Maven Plugin for Azure App Service Web Apps](https://github.com/microsoft/azure-maven-plugins/blob/develop/azure-webapp-maven-plugin/README.md) to deploy a Java web application to a Linux JBoss EAP server in Azure App Service.
1111

12-
![Screenshot of Maven Hello World web app running in Azure App Service.](../../media/quickstart-java/jboss-sample-in-app-service.png)
13-
14-
If Maven isn't your preferred development tool, check out our similar tutorials for Java developers:
15-
+ [Gradle](../../configure-language-java-deploy-run.md?pivots=platform-linux#gradle)
12+
If Maven isn't your preferred development tool, check out similar articles for Java developers:
13+
+ [Gradle](../../configure-language-java-deploy-run.md#gradle)
1614
+ [IntelliJ IDEA](/azure/developer/java/toolkit-for-intellij/create-hello-world-web-app)
1715
+ [Eclipse](/azure/developer/java/toolkit-for-eclipse/create-hello-world-web-app)
1816
+ [Visual Studio Code](https://code.visualstudio.com/docs/java/java-webapp)
1917

20-
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
18+
## Prerequisites
2119

22-
## 1 - Use Azure Cloud Shell
20+
- [!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
2321

24-
[!INCLUDE [cloud-shell-try-it-no-header.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it-no-header.md)]
22+
- Run the commands in this quickstart by using Azure Cloud Shell, an interactive shell that you can use through your browser to work with Azure services. To use Cloud Shell:
2523

26-
## 2 - Create a Java app
24+
1. Select the following **Launch Cloud Shell** button or go to https://shell.azure.com to open Cloud Shell in your browser.
25+
26+
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
2727

28-
Clone the Pet Store demo application.
28+
1. Sign in to Azure if necessary, and make sure you're in the **Bash** environment of Cloud Shell.
29+
1. Select **Copy** in a code block, paste the code into Cloud Shell, and run it.
2930

30-
```azurecli-interactive
31-
git clone https://github.com/Azure-Samples/app-service-java-quickstart
32-
```
31+
## Create a Java app
3332

34-
Change directory to the completed pet store project and build it.
33+
1. Clone the Pet Store demo application.
3534

36-
> [!TIP]
37-
> The `petstore-ee7` sample requires **Java 11 or newer**. The `booty-duke-app-service` sample project requires **Java 17**. If your installed version of Java is less than 17, run the build from within the `petstore-ee7` directory, rather than at the top level.
35+
```bash
36+
git clone https://github.com/Azure-Samples/app-service-java-quickstart
37+
```
3838

39-
```azurecli-interactive
40-
cd app-service-java-quickstart
41-
git checkout 20230308
42-
cd petstore-ee7
43-
mvn clean install
44-
```
39+
1. Change directory to the completed `petstore-ee7` project and build it.
4540

46-
If you see a message about being in **detached HEAD** state, this message is safe to ignore. Because you won't make any Git commit in this quickstart, detached HEAD state is appropriate.
41+
```bash
42+
cd app-service-java-quickstart
43+
git checkout 20230308
44+
cd petstore-ee7
45+
mvn clean install
46+
```
4747

48-
## 3 - Configure the Maven plugin
48+
If you see a message about being in detached HEAD state, you can ignore it. You don't make any Git commit in this quickstart, so detached HEAD state is appropriate.
49+
50+
> [!TIP]
51+
> The `petstore-ee7` sample requires Java 11 or newer. The `booty-duke-app-service` sample project requires Java 17. If your installed version of Java is less than 17, run the build from within the *petstore-ee7* directory instead of at the top level.
4952
50-
The deployment process to Azure App Service uses your Azure credentials from the Azure CLI automatically. If the Azure CLI isn't installed locally, then the Maven plugin authenticates with OAuth or device sign-in. For more information, see [authentication with Maven plugins](https://github.com/microsoft/azure-maven-plugins/wiki/Authentication).
53+
## Configure the Maven plugin
5154

52-
Run the Maven command shown next to configure the deployment. This command helps you to set up the App Service operating system, Java version, and Tomcat version.
55+
The App Service deployment process uses your Azure credentials from Cloud Shell automatically. The Maven plugin authenticates with OAuth or device sign-in. For more information, see [Authentication](https://github.com/microsoft/azure-maven-plugins/wiki/Authentication).
5356

54-
```azurecli-interactive
57+
Run the following Maven command to configure the deployment by setting the App Service operating system, Java version, and Jbosseap version.
58+
59+
```bash
5560
mvn com.microsoft.azure:azure-webapp-maven-plugin:2.14.1:config
5661
```
5762

58-
1. For **Create new run configuration**, type **Y**, then **Enter**.
59-
1. For **Define value for OS**, type **2** for Linux, then **Enter**.
60-
1. For **Define value for javaVersion**, type **2** for Java 17, then **Enter**. If you select Java 21, you won't see Jbosseap as an option later.
61-
1. For **Define value for webContainer**, type **4** for Jbosseap 7, then **Enter**.
62-
1. For **Define value for pricingTier**, type **1** for P1v3, then **Enter**.
63-
1. For **Confirm**, type **Y**, then **Enter**.
64-
65-
```
66-
Please confirm webapp properties
67-
AppName : petstoreee7-1745409173307
68-
ResourceGroup : petstoreee7-1745409173307-rg
69-
Region : centralus
70-
PricingTier : P1v3
71-
OS : Linux
72-
Java Version: Java 17
73-
Web server stack: Jbosseap 4
74-
Deploy to slot : false
75-
Confirm (Y/N) [Y]:
76-
[INFO] Saving configuration to pom.
77-
[INFO] ------------------------------------------------------------------------
78-
[INFO] BUILD SUCCESS
79-
[INFO] ------------------------------------------------------------------------
80-
[INFO] Total time: 01:36 min
81-
[INFO] Finished at: 2025-04-23T11:54:22Z
82-
[INFO] ------------------------------------------------------------------------
83-
```
84-
85-
After you've confirmed your choices, the plugin adds the above plugin element and requisite settings to your project's `pom.xml` file that configure your web app to run in Azure App Service.
86-
87-
The relevant portion of the `pom.xml` file should look similar to the following example.
88-
89-
```xml-interactive
63+
1. For **Create new run configuration**, type **Y** and then press **Enter**.
64+
1. For **Define value for OS**, type **2** for Linux, and then press **Enter**.
65+
1. For **Define value for javaVersion**, type **2** for Java 17, and then press **Enter**. If you select Java 21, you don't see **Jbosseap** as an option later.
66+
1. For **Define value for webContainer**, type **4** for Jbosseap 7, and then press **Enter**.
67+
1. For **Define value for pricingTier**, type **1** for P1v3, and then press **Enter**.
68+
1. For **Confirm**, type **Y** and then press **Enter**.
69+
70+
The output should look similar to the following code:
71+
72+
```bash
73+
Please confirm webapp properties
74+
AppName : petstoreee7-1745409173307
75+
ResourceGroup : petstoreee7-1745409173307-rg
76+
Region : centralus
77+
PricingTier : P1v3
78+
OS : Linux
79+
Java Version: Java 17
80+
Web server stack: Jbosseap 4
81+
Deploy to slot : false
82+
Confirm (Y/N) [Y]:
83+
[INFO] Saving configuration to pom.
84+
[INFO] ------------------------------------------------------------------------
85+
[INFO] BUILD SUCCESS
86+
[INFO] ------------------------------------------------------------------------
87+
[INFO] Total time: 01:36 min
88+
[INFO] Finished at: 2025-04-23T11:54:22Z
89+
[INFO] ------------------------------------------------------------------------
90+
```
91+
92+
After you confirm your choices, the plugin adds the plugin element and required settings to your project's *pom.xml* file, which configures your web app to run in App Service.
93+
94+
The relevant portion of the *pom.xml* file should look similar to the following example.
95+
96+
```xml
9097
<build>
9198
<plugins>
9299
<plugin>
@@ -95,43 +102,44 @@ The relevant portion of the `pom.xml` file should look similar to the following
95102
<version>x.xx.x</version>
96103
<configuration>
97104
<schemaVersion>v2</schemaVersion>
98-
<resourceGroup>your-resourcegroup-name</resourceGroup>
99-
<appName>your-app-name</appName>
105+
<resourceGroup>petstoreee7-1745409173307-rg</resourceGroup>
106+
<appName>petstoreee7-1745409173307</appName>
100107
...
101108
</configuration>
102109
</plugin>
103110
</plugins>
104-
</build>
111+
</build>
105112
```
106113

107-
You can modify the configurations for App Service directly in your `pom.xml`.
114+
The values for `<appName>` and `<resourceGroup>`, `petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` in the demo app, are used later.
115+
116+
You can modify the configurations for App Service directly in your *pom.xml* file.
108117

109118
- For the complete list of configurations, see [Common Configurations](https://github.com/microsoft/azure-maven-plugins/wiki/Common-Configuration).
110119
- For configurations specific to App Service, see [Azure Web App: Configuration Details](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App:-Configuration-Details).
111120

112-
Be careful about the values of `<appName>` and `<resourceGroup>` (`petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` accordingly in the demo). They're used later.
121+
## Deploy the app
113122

114-
## 4 - Deploy the app
123+
With all the configuration ready in your *pom.xml* file, you can deploy your Java app to Azure with the following single command.
115124

116-
With all the configuration ready in your *pom.xml* file, you can deploy your Java app to Azure with one single command.
117-
118-
```azurecli-interactive
125+
```bash
119126
# Disable testing, as it requires Wildfly to be installed locally.
120127
mvn package azure-webapp:deploy -DskipTests
121128
```
122129

123-
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready. In this demo, the URL is `http://petstoreee7-1745409173307.azurewebsites.net`. Open the URL with your local web browser, you should see
130+
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready.
131+
132+
For this demo app, the URL is `http://petstoreee7-1745409173307.azurewebsites.net`. When you open the URL with your local web browser, you should see the following app:
124133

125134
![Screenshot of Maven Hello World web app running in Azure App Service.](../../media/quickstart-java/jboss-sample-in-app-service.png)
126135

127-
**Congratulations!** You've deployed your first Java app to App Service.
136+
Congratulations! You deployed a Java app to App Service.
128137

129-
## 5 - Clean up resources
138+
## Clean up resources
130139

131-
In the preceding steps, you created Azure resources in a resource group. If you don't need the resources in the future, delete the resource group from portal, or by running the following command in the Cloud Shell:
140+
You created the resources for this tutorial in an Azure resource group. If you no longer need them, you can delete the resource group and all its resources by running the following Azure CLI command in Cloud Shell.
132141

133-
```azurecli-interactive
134-
az group delete --name <your resource group name; for example: petstoreee7-1745409173307-rg> --yes
142+
```azurecli
143+
az group delete --name petstoreee7-1745409173307-rg --yes
135144
```
136-
137-
This command may take a minute to run.
145+
The command might take a while to run.

0 commit comments

Comments
 (0)