-
Notifications
You must be signed in to change notification settings - Fork 64
Customize JRE used by Azure Functions
Shreyas Gopalakrishna edited this page Nov 9, 2021
·
10 revisions
For Windows plan:
- Open Kudu: https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#kudu
- Find the JRE you would like to use, which can be located at D:\Program Files\Java\
- Copy your JRE to a folder in d:\home. For example D:\home\MyJre
- Add AppSetting Key languageWorkers:java:defaultExecutablePath with value set to full path to your java.exe, for example d:\home\MyJre\bin\java.exe
- If your app is using consumption plan, you also need add following appsetting. Note: This will increase cold starts for java functions
- App setting key WEBSITE_USE_PLACEHOLDER with value set to 0
For Linux plan:
- The best practice is to build your own image with the specific jdk version you want to use. Please reference to this link on build your own images: https://github.com/Azure/azure-functions-docker/tree/dev/host/3.0/buster/amd64/java
- After building your own image, update the linuxfxVersion to ping to your own images. Please find more info here https://docs.microsoft.com/en-us/azure/azure-functions/set-runtime-version?tabs=portal#manual-version-updates-on-linux
- Please note this approach only works for dedicated and premium plan. For consumption, there is no Customer Container support