You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/includes/quickstart-java/quickstart-java-javase.md
+34-41Lines changed: 34 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,16 @@ ms.date: 06/10/2025
7
7
ms.author: cephalin
8
8
---
9
9
10
-
[Azure App Service](/azure/app-service/) provides a highly scalable, self-patching web app hosting service. At the top of the page, choose how you want to deploy your Java app: **Java SE**, **Tomcat**, or **JBoss EAP**, and then follow the corresponding instructions.
11
-
12
-
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 with an embedded Spring Boot, Quarkus, or Tomcat server to App Service. For more information, see [azure-webapp-maven-plugin](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App).
13
-
14
-
If Maven isn't your preferred development tool, check out our other similar tutorials for Java developers:
+[Visual Studio Code](https://code.visualstudio.com/docs/java/java-webapp)
10
+
In this quickstart, you use the Maven plugin to deploy a Java web application with an embedded Spring Boot, Quarkus, or Tomcat server to App Service by using the [azure-webapp-maven-plugin](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App).
- Run the Azure CLI and Maven commands in this tutorial by using Azure Cloud Shell, an interactive shell that you can use through your browser to work with Azure services.
16
+
- 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:
25
17
26
-
To use Cloud Shell, select **Open Cloud Shell** at upper right in a code block and sign in to Azure if necessary. Then select **Copy** in the code block, paste the code into Cloud Shell, and run it. Make sure you're using the **Bash** environment of Cloud Shell.
18
+
1. Select **Open Cloud Shell** at upper right in a code block and sign in to Azure if necessary. Make sure you're in the **Bash** environment of Cloud Shell.
19
+
1. Select **Copy** in the code block, paste the code into Cloud Shell, and run it.
27
20
28
21
## Get the sample app
29
22
@@ -68,9 +61,9 @@ Then change your working directory to the project folder by running `cd my-webap
68
61
69
62
## Configure the Maven plugin
70
63
71
-
The deployment process to Azure App Service uses your Azure credentials from Azure Cloud Shell 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).
64
+
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).
72
65
73
-
Run the Maven command shown next to configure the deployment. This command helps you to set the App Service operating system and Java version.
66
+
Run the following Maven command to configure the deployment by setting the App Service operating system and Java version.
@@ -138,25 +131,25 @@ You can modify the configurations for App Service directly in your *pom.xml* fil
138
131
With all the configuration ready in your [pom.xml](https://github.com/Azure-Samples/java-docs-embedded-tomcat/blob/main/pom.xml) file, you can deploy your Java app to Azure.
139
132
140
133
1. Build the JAR file using the following command.
141
-
134
+
142
135
### [Spring Boot](#tab/springboot)
143
136
144
137
```bash
145
138
mvn clean package
146
139
```
147
-
140
+
148
141
> [!TIP]
149
142
> Spring Boot produces two JAR files with `mvn package`, but the `azure-webapp-maven-plugin` picks the right JAR file to deploy automatically.
Set the Quarkus port in the *application.properties* file to the `PORT` environment variable in the Linux Java container. `Dquarkus.package.jar.type=uber-jar` tells Maven to [generate an Uber-Jar](https://quarkus.io/guides/maven-tooling#uber-jar-maven), which includes all dependencies in the JAR file.
159
-
152
+
160
153
> [!TIP]
161
154
> Quarkus produces two JAR files with `mvn package`, but `azure-webapp-maven-plugin` picks the right JAR file to deploy automatically.
162
155
@@ -165,23 +158,23 @@ With all the configuration ready in your [pom.xml](https://github.com/Azure-Samp
165
158
```bash
166
159
mvn clean package
167
160
```
168
-
169
-
To make the application deploy using [azure-webapp-maven-plugin](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App) and run on Azure App Service, the sample configures the `package` goal as follows:
161
+
162
+
To make the application deploy using the [azure-webapp-maven-plugin](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App) and run on Azure App Service, the sample configures the `package` goal as follows:
170
163
171
164
- Builds a single uber JAR file, which contains everything the application needs to run.
172
165
- Creates an [executable JAR](https://en.wikipedia.org/wiki/JAR_(file_format)#Executable_JAR_files) by specifying the Tomcat class as the startup class.
173
166
- Replaces the original artifact with the `Uber-Jar` to ensure that the deploy step deploys the right file.
174
-
167
+
175
168
-----
176
-
169
+
177
170
1. Deploy the app to Azure by using the following command:
178
-
171
+
179
172
```bash
180
173
mvn azure-webapp:deploy
181
174
```
182
-
175
+
183
176
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready, and you see the following output:
184
-
177
+
185
178
```output
186
179
[INFO] Successfully deployed the artifact to <URL>
Open your app's default domain from the **Overview** page in the Azure portal, and append `/greeting` to the URL. You should see the following app:
200
-
193
+
201
194
:::image type="content" source="../../media/quickstart-java/springboot-hello-world-in-browser-azure-app-service.png" alt-text="Screenshot of Spring Boot Hello World web app running in Azure App Service.":::
202
-
195
+
203
196
### [Quarkus](#tab/quarkus)
204
-
197
+
205
198
Open your app's default domain from the **Overview** in the Azure portal, and append `/hello` to the URL. You should see the following app:
206
-
199
+
207
200
:::image type="content" source="../../media/quickstart-java/quarkus-hello-world-in-browser-azure-app-service.png" alt-text="Screenshot of Quarkus web app running in Azure App Service.":::
208
-
201
+
209
202
### [Embedded Tomcat](#tab/embeddedtomcat)
210
-
203
+
211
204
Open the URL for your app's default domain from the **Overview** in the Azure portal. You should see the following app:
212
-
205
+
213
206
:::image type="content" source="../../media/quickstart-java/embedded-tomcat-hello-world-in-browser-azure-app-service.png" alt-text="Screenshot of embedded Tomcat web app running in Azure App Service.":::
214
-
207
+
215
208
-----
216
209
217
210
Congratulations! You deployed a Java app to App Service.
@@ -221,8 +214,8 @@ Congratulations! You deployed a Java app to App Service.
221
214
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 the Cloud Shell.
222
215
223
216
```azurecli-interactive
224
-
az group delete --name <your resource group name> --yes
217
+
az group delete --name <resource group name> --yes
225
218
```
226
219
227
-
For example, run `az group delete --name quarkus-hello-azure-1690375364238-rg --yes`. This command might take awhile to run.
220
+
For example, run `az group delete --name quarkus-hello-azure-1690375364238-rg --yes`. This command might take a while to run.
Copy file name to clipboardExpand all lines: articles/app-service/includes/quickstart-java/quickstart-java-jboss.md
+16-22Lines changed: 16 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,16 @@ ms.date: 06/10/2025
7
7
ms.author: cephalin
8
8
---
9
9
10
-
[Azure App Service](/azure/app-service/) provides a highly scalable, self-patching web app hosting service. At the top of the page, choose how you want to deploy your Java app: **Java SE**, **Tomcat**, or **JBoss EAP**, and then follow the corresponding instructions.
11
-
12
-
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 App Service.
13
-
14
-
If Maven isn't your preferred development tool, check out our similar tutorials for Java developers:
- Run the Azure CLI and Maven commands in this tutorial by using Azure Cloud Shell, an interactive shell that you can use through your browser to work with Azure services.
16
+
- 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:
25
17
26
-
To use Cloud Shell, select **Open Cloud Shell** at upper right in a code block and sign in to Azure if necessary. Then select **Copy** in the code block, paste the code into Cloud Shell, and run it. Make sure you're using the **Bash** environment of Cloud Shell.
18
+
1. Select **Open Cloud Shell** at upper right in a code block and sign in to Azure if necessary. Make sure you're in the **Bash** environment of Cloud Shell.
19
+
1. Select **Copy** in the code block, paste the code into Cloud Shell, and run it.
27
20
28
21
## Create a Java app
29
22
@@ -42,14 +35,14 @@ If Maven isn't your preferred development tool, check out our similar tutorials
42
35
mvn clean install
43
36
```
44
37
38
+
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.
39
+
45
40
> [!TIP]
46
-
> 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.
47
-
48
-
If you see a message about being in detached HEAD state, you can ignore it. You won't make any Git commit in this quickstart, so detached HEAD state is appropriate.
41
+
> 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.
49
42
50
43
## Configure the Maven plugin
51
44
52
-
The App Service deployment process uses your Azure credentials from Azure 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).
45
+
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).
53
46
54
47
Run the following Maven command to configure the deployment by setting the App Service operating system, Java version, and Jbosseap version.
55
48
@@ -99,16 +92,16 @@ The relevant portion of the *pom.xml* file should look similar to the following
The values for `<appName>` and `<resourceGroup>`, `petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` in the demo code, are used later.
104
+
The values for `<appName>` and `<resourceGroup>`, `petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` in the demo app, are used later.
112
105
113
106
You can modify the configurations for App Service directly in your *pom.xml* file.
114
107
@@ -124,7 +117,9 @@ With all the configuration ready in your *pom.xml* file, you can deploy your Jav
124
117
mvn package azure-webapp:deploy -DskipTests
125
118
```
126
119
127
-
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready. For this demo, the URL is `http://petstoreee7-1745409173307.azurewebsites.net`. When you open the URL with your local web browser, you should see the following app:
120
+
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready.
121
+
122
+
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:
128
123
129
124

130
125
@@ -135,7 +130,6 @@ Congratulations! You deployed a Java app to App Service.
135
130
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 the Cloud Shell.
136
131
137
132
```azurecli-interactive
138
-
az group delete --name <your resource group name> --yes
133
+
az group delete --name petstoreee7-1745409173307-rg --yes
139
134
```
140
-
141
-
For example, to delete the demo resources, run `az group delete --name petstoreee7-1745409173307-rg --yes`. This command might take awhile to run.
0 commit comments