Azure Appservice creation with Linux Tomcat combination

Hi All,

Doing some testing with terraform templates for Azure Appservice creation, I’ve noticed It is not possible to deploy and Appservice with Tomcat & Linux default images .

I have used the following template example to try to create this environment without success.

https://github.com/Azure/terraform/tree/master/quickstart/101-web-app-linux-java

When running “terraform apply” (after some changes like increase version an adding a feature tag) it runs but the image deployed is not a java image. It seems It is a PHP image although the template uses Java Tomcat Values. Example:

resource “azurerm_app_service_plan” “default” {
name = “{var.name}-plan" location = "{azurerm_resource_group.default.location}”
resource_group_name = “${azurerm_resource_group.default.name}”
kind = “Linux”
reserved = true

sku {
tier = “{var.plan_tier}" size = "{var.plan_sku}”
}
}

resource “azurerm_app_service” “default” {
name = “{var.dns_prefix}-{var.name}-{var.environment}-app" location = "{azurerm_resource_group.default.location}”
resource_group_name = “{azurerm_resource_group.default.name}" app_service_plan_id = "{azurerm_app_service_plan.default.id}”

site_config {
always_on = true
java_version = "1.8"
java_container = "tomcat"
java_container_version = "9.0"
}
}

Checking the Appservice instance deployed:


/ _ \ __________ _________ ____
/ /\ ___ / | _ __ _/ __
/ | / /| | /| | /\ /
_
|__ /_____ _
/ || ___ >
/ / /
A P P S E R V I C E O N L I N U X

Documentation: http://aka.ms/webapp-linux
PHP quickstart: https://aka.ms/php-qs
PHP version : 7.0.33
Note: Any data outside ‘/home’ is not persisted
root@61c8f946a626:/home# java -version
-bash: java: command not found
root@61c8f946a626:/home# cd /usr/local/
bin/ games/ lib/ php/ share/ var/
etc/ include/ man/ sbin/ src/
root@61c8f946a626:/home#

I’ve tested changing Tomcat versions with no success. I’ve also tested removing the OS parameters:

kind = “Linux”
reserved = true

It seems to work perfectly deploying the appService resource with a Windows/Tomcat image.

Any Idea?

Thank you,

Regards