Skip to content

Commit 002cc59

Browse files
committed
Add docs on EnableWorkerIndexing
1 parent 2b11d94 commit 002cc59

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,40 @@ At the root of the project, there's a shared [host.json](functions-host-json.md)
6868

6969
::: zone pivot="nodejs-model-v4"
7070

71+
## Enable v4 programming model
72+
73+
The following application setting is required to run the v4 programming model while it is in preview:
74+
- Name: `AzureWebJobsFeatureFlags`
75+
- Value: `EnableWorkerIndexing`
76+
77+
If you're running locally using [Azure Functions Core Tools](functions-run-local.md), you should add this setting to your `local.settings.json` file. If you're running in Azure, follow these steps with the tool of your choice:
78+
79+
# [Azure CLI](#tab/azure-cli-set-indexing-flag)
80+
81+
Replace `<FUNCTION_APP_NAME>` and `<RESOURCE_GROUP_NAME>` with the name of your function app and resource group, respectively.
82+
83+
```azurecli
84+
az functionapp config appsettings set --name <FUNCTION_APP_NAME> --resource-group <RESOURCE_GROUP_NAME> --settings AzureWebJobsFeatureFlags=EnableWorkerIndexing
85+
```
86+
87+
# [Azure PowerShell](#tab/azure-powershell-set-indexing-flag)
88+
89+
Replace `<FUNCTION_APP_NAME>` and `<RESOURCE_GROUP_NAME>` with the name of your function app and resource group, respectively.
90+
91+
```azurepowershell
92+
Update-AzFunctionAppSetting -Name <FUNCTION_APP_NAME> -ResourceGroupName <RESOURCE_GROUP_NAME> -AppSetting @{"AzureWebJobsFeatureFlags" = "EnableWorkerIndexing"}
93+
```
94+
95+
# [VS Code](#tab/vs-code-set-indexing-flag)
96+
97+
1. Make sure you have the [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) installed
98+
1. Press <kbd>F1</kbd> to open the command palette. In the command palette, search for and select `Azure Functions: Add New Setting...`.
99+
1. Choose your subscription and function app when prompted
100+
1. For the name, type `AzureWebJobsFeatureFlags` and press <kbd>Enter</kbd>.
101+
1. For the value, type `EnableWorkerIndexing` and press <kbd>Enter</kbd>.
102+
103+
---
104+
71105
## Folder structure
72106

73107
The recommended folder structure for a JavaScript project looks like the following example:

includes/functions-nodejs-model-considerations.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ ms.custom: include file
1111

1212
## Considerations
1313

14-
- The Node.js "programming model" should not be confused with the Azure Functions "runtime".
15-
- _**Programming model**_: The part of Azure Functions specific to JavaScript and TypeScript that governs how you author your code.
16-
- _**Runtime**_: The central part of Azure Functions that governs underlying behavior shared across all languages.
17-
- The programming model version is strictly tied to the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package, and is versioned independently of the [runtime](../articles/azure-functions/functions-versions.md). Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
18-
- Keep in mind that you can't mix the v3 and v4 programming models in the same function app. As soon as you register one v4 function in your app, any v3 functions registered in `function.json` files will be ignored.
19-
2014
> [!NOTE]
21-
> Version 4 of the Node.js programming model is currently in public preview.
15+
> Version 4 of the Node.js programming model is currently in public preview.
16+
17+
- During preview, the v4 model requires you to set the app setting `AzureWebJobsFeatureFlags` to `EnableWorkerIndexing`. For more information, see [Enable v4 programming model](../articles/azure-functions/functions-reference-node.md#enable-v4-programming-model).
18+
- The Node.js "programming model" shouldn't be confused with the Azure Functions "runtime".
19+
- _**Programming model**_: Defines how you author your code and is specific to JavaScript and TypeScript.
20+
- _**Runtime**_: Defines underlying behavior of Azure Functions and is shared across all languages.
21+
- The programming model version is strictly tied to the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package, and is versioned independently of the [runtime](../articles/azure-functions/functions-versions.md). Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
22+
- Keep in mind that you can't mix the v3 and v4 programming models in the same function app. As soon as you register one v4 function in your app, any v3 functions registered in `function.json` files are ignored.

0 commit comments

Comments
 (0)