-
Notifications
You must be signed in to change notification settings - Fork 61
Customize JRE used by Azure Functions
kaibocai edited this page Dec 5, 2022
·
10 revisions
For Mitigation for the TLS issue, please visit here
For Windows plan:
-
You can use one of the Azure JREs or you can bring you own JRE
- Use one of the Azure JREs
- Find the JRE you would like to use, which can be located at D:\Program Files\Java\
- Add AppSetting Key languageWorkers:java:defaultExecutablePath with value set to full path to the required java.exe, for example - D:\Program Files\Java\<version>\bin\java.exe
- Bring you own JRE
- 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
- Use one of the Azure JREs
-
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:
- You can build your own image or you can use previous azure function image
-
Build your own image
- 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
-
Use previous azure function image
- Please follow Manual version updates on linux
-