Skip to content

Commit f95e266

Browse files
Merge pull request #2 from ggailey777/patch-4
Suggestion for your addition
2 parents aa8e32b + 281b93d commit f95e266

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

articles/azure-functions/functions-reference-java.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Functions lets you customize the Java virtual machine (JVM) used to run your Jav
120120

121121
You can provide additional arguments in an app setting named `JAVA_OPTS`. You can add app settings to your function app deployed to Azure in the Azure portal or the Azure CLI.
122122

123+
> [!IMPORTANT]
124+
> In the Consumption plan, you must also add the WEBSITE_USE_PLACEHOLDER setting with a value of 0 for the customization to work. This setting does increase the cold start times for Java functions.
125+
123126
### Azure portal
124127

125128
In the [Azure portal](https://portal.azure.com), use the [Application Settings tab](functions-how-to-use-azure-function-app-settings.md#settings) to add the `JAVA_OPTS` setting.
@@ -128,15 +131,22 @@ In the [Azure portal](https://portal.azure.com), use the [Application Settings t
128131

129132
You can use the [az functionapp config appsettings set](/cli/azure/functionapp/config/appsettings) command to set `JAVA_OPTS`, as in the following example:
130133

134+
#### [Consumption plan](#tab/consumption)
135+
```azurecli-interactive
136+
az functionapp config appsettings set \
137+
--settings "JAVA_OPTS=-Djava.awt.headless=true" \
138+
"WEBSITE_USE_PLACEHOLDER=0" \
139+
--name <APP_NAME> --resource-group <RESOURCE_GROUP>
140+
```
141+
#### [Dedicated plan / Premium plan](#tab/dedicated+premium)
131142
```azurecli-interactive
132-
az functionapp config appsettings set --name <APP_NAME> \
133-
--resource-group <RESOURCE_GROUP> \
134-
--settings "JAVA_OPTS=-Djava.awt.headless=true"
143+
az functionapp config appsettings set \
144+
--settings "JAVA_OPTS=-Djava.awt.headless=true" \
145+
--name <APP_NAME> --resource-group <RESOURCE_GROUP>
135146
```
136-
This example enables headless mode. Replace `<APP_NAME>` with the name of your function app, and `<RESOURCE_GROUP>` with the resource group.
147+
---
137148

138-
> [!WARNING]
139-
> In the Consumption plan, you must also add the WEBSITE_USE_PLACEHOLDER setting with a value of 0 for the customization to work. This setting does increase the cold start times for Java functions.
149+
This example enables headless mode. Replace `<APP_NAME>` with the name of your function app, and `<RESOURCE_GROUP>` with the resource group.
140150

141151
## Third-party libraries
142152

0 commit comments

Comments
 (0)