Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Java 21 for azurerm_linux_web_app #25490

Closed
1 task done
christian-anker-larsen opened this issue Apr 2, 2024 · 14 comments · Fixed by #26304
Closed
1 task done

Support for Java 21 for azurerm_linux_web_app #25490

christian-anker-larsen opened this issue Apr 2, 2024 · 14 comments · Fixed by #26304

Comments

@christian-anker-larsen
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

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? 🙏🏻

image

Thank you.

New or Affected Resource(s)/Data Source(s)

azurerm_linux_web_app

Potential Terraform Configuration

application_stack {
      java_version = 21
    }

References

No response

@christian-anker-larsen
Copy link
Author

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.

image

@ppa-fyayc
Copy link

The announcement is here: https://techcommunity.microsoft.com/t5/apps-on-azure-blog/announcing-java-21-and-tomcat-10-1-on-azure-app-service/ba-p/4105714

@ppa-fyayc
Copy link

@christian-anker-larsen are you going to reopen this issue?

@christian-anker-larsen
Copy link
Author

@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:

image

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.

@ppa-fyayc
Copy link

Oh, I see what you mean :( That's a shame! Let's wait then.

@ppa-fyayc
Copy link

ppa-fyayc commented Apr 14, 2024

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"
      }
    }
  })
}

@iAMSagar44
Copy link

@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.

image

@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?

@ppa-fyayc
Copy link

ppa-fyayc commented Apr 21, 2024

@iAMSagar44 Right, the site_config you posted does not work yet. That's why I posted the workaround via the azapi provider.

@christian-anker-larsen
Copy link
Author

@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.

@onclebendusud

This comment was marked as duplicate.

@ghost
Copy link

ghost commented Jun 7, 2024

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.

@sudeepvarma2017
Copy link

Is there any ETA for this issue ?

@MarcelTemp
Copy link

What is the status here?

@computerlove
Copy link
Contributor

The status is that I have a PR that has a failing test, that I have no idea how to resolve.

@github-actions github-actions bot added this to the v4.14.0 milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants