Skip to content

Commit b84da14

Browse files
author
Jill Grant
authored
Merge pull request #243305 from ggailey777/madhura
[Functions] Add portal tab for node.js version upgrade
2 parents d550730 + af7395f commit b84da14

File tree

3 files changed

+65
-7
lines changed

3 files changed

+65
-7
lines changed

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

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,21 +1418,62 @@ You can see the current version that the runtime is using by logging `process.ve
14181418
14191419
### Setting the Node version
14201420
1421-
# [Windows](#tab/windows-setting-the-node-version)
1421+
The way that you upgrade your Node.js version depends on the OS on which your function app runs.
14221422
1423-
For Windows function apps, target the version in Azure by setting the `WEBSITE_NODE_DEFAULT_VERSION` [app setting](functions-how-to-use-azure-function-app-settings.md#settings) to a supported LTS version, such as `~18`.
1423+
# [Windows](#tab/windows)
14241424
1425-
# [Linux](#tab/linux-setting-the-node-version)
1425+
When running on Windows, the Node.js version is set by the [`WEBSITE_NODE_DEFAULT_VERSION`](./functions-app-settings.md#website_node_default_version) application setting. This setting can be updated either by using the Azure CLI or in the Azure portal.
14261426
1427-
For Linux function apps, run the following Azure CLI command to update the Node version.
1427+
# [Linux](#tab/linux)
14281428
1429-
```azurecli
1430-
az functionapp config set --linux-fx-version "node|18" --name "<MY_APP_NAME>" --resource-group "<MY_RESOURCE_GROUP_NAME>"
1429+
When running on Windows, the Node.js version is set by the [linuxfxversion](./functions-app-settings.md#linuxfxversion) site setting. This setting can be updated using the Azure CLI.
1430+
1431+
---
1432+
1433+
For more information about Node.js versions, see [Supported versions](#supported-versions).
1434+
1435+
Before upgrading your Node.js version, make sure your function app is running on the latest version of the Azure Functions runtime. If you need to upgrade your runtime version, see [Migrate apps from Azure Functions version 3.x to version 4.x](migrate-version-3-version-4.md?pivots=programming-language-javascript).
1436+
1437+
# [Azure CLI](#tab/azure-cli/windows)
1438+
1439+
Run the Azure CLI [`az functionapp config appsettings set`](/cli/azure/functionapp/config#az-functionapp-config-appsettings-set) command to update the Node.js version for your function app running on Windows:
1440+
1441+
```azurecli-interactive
1442+
az functionapp config appsettings set --settings WEBSITE_NODE_DEFAULT_VERSION=~18 \
1443+
--name <FUNCTION_APP_NAME> --resource-group <RESOURCE_GROUP_NAME>
1444+
```
1445+
1446+
This sets the [`WEBSITE_NODE_DEFAULT_VERSION` application setting](./functions-app-settings.md#website_node_default_version) the supported LTS version of `~18`.
1447+
1448+
# [Azure portal](#tab/azure-portal/windows)
1449+
1450+
Use the following steps to change the Node.js version:
1451+
1452+
[!INCLUDE [functions-set-nodejs-version-portal](../../includes/functions-set-nodejs-version-portal.md)]
1453+
1454+
# [Azure CLI](#tab/azure-cli/linux)
1455+
1456+
Run the Azure CLI [`az functionapp config set`](/cli/azure/functionapp/config#az-functionapp-config-set) command to update the Node.js version for your function app running on Linux:
1457+
1458+
```azurecli-interactive
1459+
az functionapp config set --linux-fx-version "node|18" --name "<FUNCTION_APP_NAME>" \
1460+
--resource-group "<RESOURCE_GROUP_NAME>"
14311461
```
14321462
1463+
This sets the base image of the Linux function app to Node.js version 18.
1464+
1465+
# [Azure portal](#tab/azure-portal/linux)
1466+
1467+
>[!NOTE]
1468+
> You can't change the Node.js version in the Azure portal when your function app is running on Linux in a Consumption plan. Instead use the Azure CLI.
1469+
1470+
For Premium and Dedicated plans, use the following steps to change the Node.js version:
1471+
1472+
[!INCLUDE [functions-set-nodejs-version-portal](../../includes/functions-set-nodejs-version-portal.md)]
1473+
14331474
---
14341475
1435-
To learn more about Azure Functions runtime support policy, refer to this [article](./language-support-policy.md).
1476+
After changes are made, your function app restarts. To learn more about Functions support for Node.js, see [Language runtime support policy](./language-support-policy.md).
14361477
14371478
<a name="access-environment-variables-in-code"></a>
14381479
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 06/28/2023
6+
ms.author: glenga
7+
---
8+
9+
1. In the [Azure portal](https://portal.azure.com), locate your function app and select **Configuration** on the left-hand side.
10+
11+
1. Select the **Function runtime settings** tab and verify that your function app is running on the latest version of the Functions runtime.
12+
13+
1. Select the **General settings** tab and update the **Node.js Version** to the latest version. Ideally, you have already locally verified that your functions run on the version you select.
14+
15+
:::image type="content" source="media/functions-set-nodejs-version-portal/set-nodejs-version-portal.png" alt-text="Screenshot of setting Node.js for the function app to the latest LTS version in the Azure portal. ":::
16+
17+
1. When notified about a restart, select **Continue**, and then select **Save**.
89 KB
Loading

0 commit comments

Comments
 (0)