-
Notifications
You must be signed in to change notification settings - Fork 57
Customize JVM to use Zulu
In early 2022, Azure Functions will begin distributing Microsoft builds of the OpenJDK for Java 11 and Adoptium Temurin binaries for Java 8. If you would like to configure your Function app to continue using the Zulu binaries, follow the instructions below.
Please note that bug fixes, security patches, and new features are only made available in new versions of the OpenJDK (and not often backported to previous versions). Therefore, we recommend that you only pin your Function app to an old Java version as a temporary mitigation.
Notes: Below linux approach is temporary and will be depreciated in 6 months.
There are two methods to configure your Function app to use the Zulu binaries:
-
Create an app setting named
languageWorkers:java:defaultExecutablePath
with one of the following values:-
Java 8: set value to
C:\Program Files\Java\zulu8.54.0.21-jre8.0.292-win_x64\bin\java.exe
-
Java 11: set value to
C:\Program Files\Java\zulu11.48.21-jre11.0.11-win_x64\bin\java.exe
-
Java 8: set value to
-
Run the CLI command
az functionapp config set -g \<resource-group\> -n \<function name\> --java-version "< correct java version >"
. For example:-
Java 8:
az functionapp config set -g java-functions-group-demo-mamoun-trigger -n testdemo-demo-mamoun-trigger --java-version "1.8.0_292"
-
Java 11:
az functionapp config set -g java-functions-group-demo-mamoun-trigger -n testdemo-demo-mamoun-trigger --java-version "11.0.11"
More details about this CLI command can be found at az functionapp config set.
-
If your app is using Consumption plan, you will also need add an app setting named WEBSITE_USE_PLACEHOLDER
with value of 0
. Note: This will increase cold start time of your Java functions.
More info can be found at Manual version updates on linux.
For Functions running on an App Service Plan, Premium plan and Consumption Plan:
- Java 8: set
LinuxFxVersion
toJAVA|8.1
- Java 11: set
LinuxFxVersion
toJAVA|11.1