Skip to content

How to customize JVM options on Azure Functions

kaibocai edited this page Jan 19, 2023 · 9 revisions

Customize JVM options on Azure Functions

  • Dedicated and Premium Functions:
    Create an app setting named JAVA_OPTS with a value of your customizing parameters for example “-Dexample=true”. If you already have the JAVA_OPTS app setting set, just append “-Dexample=true” to the existing value.

  • Consumption Functions:
    Create an app setting named languageWorkers__java__arguments with a value of “-Dexample=true”.

More examples can be find here: https://github.com/Azure/azure-functions-java-worker/issues/474

Case - Update JVM heap size

Dedicate plan (P1V2)

  • default (without setting JAVA_OPTS): heap size is 711589888 bytes
image
  • set JAVA_OPTS to -Xmx2g: heap size is 2075918336 bytes
image

The sample apply to appsetting languageWorkers__java__arguments on consumption plan.