Skip to content

Commit 4f24959

Browse files
committed
Add more details on FUNCTIONS_NODE_BLOCK_ON_ENTRY_POINT_ERROR
1 parent 5d4f6c4 commit 4f24959

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

articles/azure-functions/functions-app-settings.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,22 @@ The following major runtime version values are supported:
319319
| `~2` | 2.x | No longer supported |
320320
| `~1` | 1.x | Supported |
321321

322+
## FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR
323+
324+
This app setting was added as a temporary way for apps on Node.js v18 and lower to replicate a breaking change introduced in Node.js v20+. Starting in Node.js v20, Azure Functions treats entry point errors as blocking errors and log the errors in Application Insights. In Node.js v18 or lower, entry point errors are ignored as warnings and aren't visible in Application Insights.
325+
326+
For Node.js v20+, this app setting has no effect. For Node.js v18 or lower, the default behavior depends on your programming model version:
327+
- Model v3: The default value for the app setting is `0`.
328+
- Model v4: The default value for the app setting depends on if the error happens before or after the first model v4 function is registered (by calling `app.http()`, `app.timer()`, etc.).
329+
- If the error is thrown before, the default behavior matches a setting value of `0`. For example, if your entry point file doesn't exist, the error is ignored.
330+
- If the error is thrown after, the default behavior matches a setting value of `1`. For example, if you try to register the same function name a second time, the error blocks your app from running and is logged in app insights.
331+
332+
This setting is most applicable to model v4 apps, because they require entry point files unlike model v3. It's highly recommended to set the app setting to `1`, because ignoring entry point errors can lead to unexpected behavior (like "No functions found"). Since the ignored warnings don't show up in app insights, it can be difficult to troubleshoot any problems. When changing the setting to `1`, you may need to fix any errors that were previously ignored.
333+
334+
|Key|Sample value|
335+
|---|------------|
336+
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`1`|
337+
322338
## FUNCTIONS\_V2\_COMPATIBILITY\_MODE
323339

324340
This setting enables your function app to run in a version 2.x compatible mode on the version 3.x runtime. Use this setting only if encountering issues after upgrading your function app from version 2.x to 3.x of the runtime.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Try the following fixes:
4646
- When running in Azure:
4747
- Make sure you're using [Azure Functions Runtime Version](./functions-versions.md) 4.25 or higher.
4848
- Make sure you're using Node.js v18 or higher.
49-
- Set the app setting `FUNCTIONS_NODE_BLOCK_ON_ENTRY_POINT_ERROR` to `1`. This setting is recommended for all model v4 apps and ensures that all entry point errors are visible in your application insights logs.
49+
- Set the app setting [`FUNCTIONS_NODE_BLOCK_ON_ENTRY_POINT_ERROR`](./functions-app-settings.md#functions_node_block_on_entry_point_error) to `1`. This setting is recommended for all model v4 apps and ensures that all entry point errors are visible in your application insights logs.
5050
- Check your function app logs for entry point errors. The following example query shows how to view entry point errors for your app in the past day:
5151

5252
```kusto

0 commit comments

Comments
 (0)