You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-node.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,40 @@ At the root of the project, there's a shared [host.json](functions-host-json.md)
68
68
69
69
::: zone pivot="nodejs-model-v4"
70
70
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
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
+
71
105
## Folder structure
72
106
73
107
The recommended folder structure for a JavaScript project looks like the following example:
Copy file name to clipboardExpand all lines: includes/functions-nodejs-model-considerations.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,12 @@ ms.custom: include file
11
11
12
12
## Considerations
13
13
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
-
20
14
> [!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