Skip to content

Commit fa28aae

Browse files
mgmt, web, runtime for tomcat java17 (Azure#27445)
1 parent d3c274a commit fa28aae

File tree

6 files changed

+280
-8
lines changed

6 files changed

+280
-8
lines changed

sdk/resourcemanager/azure-resourcemanager-appservice/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Supported Tomcat 10 and Java 8, 11, 17 in `RuntimeStack` for `WebApp`.
128

139
## 2.12.0 (2022-02-14)
1410

sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public class RuntimeStack {
7777
/** Tomcat 9.0-jre8 image with catalina root set to Azure wwwroot. */
7878
public static final RuntimeStack TOMCAT_9_0_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "9.0-jre8"));
7979

80+
/** Tomcat 10.0-java17 image with catalina root set to Azure wwwroot. */
81+
public static final RuntimeStack TOMCAT_10_0_JAVA17 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-java17"));
82+
83+
/** Tomcat 10.0-jre11 image with catalina root set to Azure wwwroot. */
84+
public static final RuntimeStack TOMCAT_10_0_JRE11 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-jre11"));
85+
86+
/** Tomcat 10.0-jre8 image with catalina root set to Azure wwwroot. */
87+
public static final RuntimeStack TOMCAT_10_0_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-jre8"));
88+
8089
/** JBOSS EAP 7.2-java8. */
8190
public static final RuntimeStack JBOSS_EAP_7_2_JAVA8 =
8291
COLLECTION.addValue(new RuntimeStack("JBOSSEAP", "7.2-java8"));

sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/LinuxWebAppsTests.java

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile
3838

3939
@Override
4040
protected void cleanUpResources() {
41-
resourceManager.resourceGroups().beginDeleteByName(rgName2);
42-
resourceManager.resourceGroups().beginDeleteByName(rgName1);
41+
if (rgName2 != null) {
42+
resourceManager.resourceGroups().beginDeleteByName(rgName2);
43+
}
44+
if (rgName1 != null) {
45+
resourceManager.resourceGroups().beginDeleteByName(rgName1);
46+
}
4347
}
4448

4549
@Test
@@ -190,4 +194,29 @@ public void canCRUDLinuxJava11WebApp() throws Exception {
190194
Assertions.assertTrue(body.contains("Hello world from linux 4"));
191195
}
192196
}
197+
198+
@Test
199+
public void canCRUDLinuxJava17WebApp() throws Exception {
200+
// Create with new app service plan
201+
WebApp webApp1 =
202+
appServiceManager
203+
.webApps()
204+
.define(webappName1)
205+
.withRegion(Region.US_WEST)
206+
.withNewResourceGroup(rgName1)
207+
.withNewLinuxPlan(PricingTier.BASIC_B1)
208+
.withBuiltInImage(RuntimeStack.TOMCAT_10_0_JAVA17)
209+
.create();
210+
Assertions.assertNotNull(webApp1);
211+
Assertions.assertEquals(Region.US_WEST, webApp1.region());
212+
AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId());
213+
Assertions.assertNotNull(plan1);
214+
Assertions.assertEquals(Region.US_WEST, plan1.region());
215+
Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier());
216+
Assertions.assertEquals(OperatingSystem.LINUX, plan1.operatingSystem());
217+
Assertions.assertEquals(OperatingSystem.LINUX, webApp1.operatingSystem());
218+
Assertions.assertEquals(String.format("%s|%s", RuntimeStack.TOMCAT_10_0_JAVA17.stack(), RuntimeStack.TOMCAT_10_0_JAVA17.version()), webApp1.linuxFxVersion());
219+
220+
rgName2 = null;
221+
}
193222
}

0 commit comments

Comments
 (0)