Open christian-anker-larsen opened 8 months ago
I did some further investigation in Azure Portal, and it seems that even though Java 21
is selectable in my web app's configuration, I am unable to save the changes. I then attempted to create a new Linux-based resource manually via Azure Portal with Java 21
. As per the screenshot below, selecting this version disables the Linux
option in the Operating System
field. This seems to indicate that Java 21
is not yet supported on Linux based Web Apps.
In other words, this issue is not an actual issue (yet), so I am closing it for now.
@christian-anker-larsen are you going to reopen this issue?
@ppa-fyayc I made another attempt in Azure Portal to create a Web App in Linux OS, but I am still seeing this, when selecting Java 21
:
To me, it looks like that the announcement implicitly only applies for Windows OS. Not sure if it makes sense to reopen this issue until Linux is supported as well.
Oh, I see what you mean :( That's a shame! Let's wait then.
I was able to upgrade my linux web app to Java 21 using
resource "azapi_update_resource" "backend-webapp-java-21" {
type = "Microsoft.Web/sites@2023-01-01"
resource_id = azurerm_linux_web_app.backend.id
body = jsonencode({
properties = {
siteConfig = {
linuxFxVersion = "JAVA|21-java21"
}
}
})
}
@christian-anker-larsen - I had encountered the same issue, but I can now see that Java 21 is supported for Azure App Service on Linux.
@ppa-fyayc - I am unable to upgrade to Java 21 with the below terraform script -
site_config {
application_stack {
java_server = "JAVA"
java_version = "21"
java_server_version = "21"
}
}
It fails Terraform validation.
@christian-anker-larsen - I think this issue should be reopened. Thoughts?
@iAMSagar44 Right, the site_config you posted does not work yet. That's why I posted the workaround via the azapi provider.
@iAMSagar44 I just checked Azure Portal, and it's now possible to create Web Apps on Linux w/ Java 21. Also tried modifying an existing web app, and there it was also possible to change to Java 21, so, yes, I am reopening this issue.
Good morning, is there a plan(ning) for adding java21 in azurerm_linux_web_app ? It's just to have an expected date for the availability.
Just to build on the work-around provided by @ppa-fyayc:
You might want to add the replace_triggered_by
lifecycle to azapi_update_resource
. I'm experiencing that if any fields in the azurerm_linux_web_app
is later changed by Terraform, for instance, site_config
, then the application stack is set to JAVA|21-
and not JAVA|21-java21
. JAVA|21-
is an invalid value, and will most likely cause your app to stop working.
Here's a complete example for reference:
resource "azapi_update_resource" "backend-webapp-java-21" {
type = "Microsoft.Web/sites@2023-01-01"
resource_id = azurerm_linux_web_app.backend.id
body = jsonencode({
properties = {
siteConfig = {
linuxFxVersion = "JAVA|21-java21"
}
}
})
lifecycle {
replace_triggered_by = [
azurerm_linux_web_app.backend
]
}
}
This will force azapi_update_resource
to be recreated, setting the application stack back to JAVA|21-java21
.
Is there any ETA for this issue ?
What is the status here?
The status is that I have a PR that has a failing test, that I have no idea how to resolve.
Is there an existing issue for this?
Community Note
Description
As evidenced from the screenshot below taken in Azure Portal on 2nd April 2024, Azure Web Apps now support Java 21. For this reason, it would be great if Java 21 is supported in the
azurerm_linux_web_app
resource as well. Would it be possible to implement this any time in the foreseeable future? 🙏🏻Thank you.
New or Affected Resource(s)/Data Source(s)
azurerm_linux_web_app
Potential Terraform Configuration
References
No response