Skip to content

Commit 0984c9e

Browse files
committed
Improve block_error setting docs
1 parent 6df187c commit 0984c9e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,19 +321,18 @@ The following major runtime version values are supported:
321321

322322
## FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR
323323

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.
324+
This app setting is a temporary way for Node.js apps to enable a breaking change that makes entry point errors easier to troubleshoot. It's highly recommended to set this to `true` on Node.js v18 or lower, especially for programming model v4 apps which always use entry point files. The behavior without the breaking change treats entry point errors as warnings and will not log them in Application Insights.
325325

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.
326+
Starting with Node.js v20, the app setting has no effect and the breaking change behavior is always enabled.
331327

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.
328+
For Node.js v18 or lower, the app setting can be used and the default behavior depends on if the error happens before or after a model v4 function has been registered:
329+
- If the error is thrown before, the default behavior matches `false`. For example, if you are using model v3 or your entry point file doesn't exist.
330+
- If the error is thrown after, the default behavior matches `true`. For example, if you try to register duplicate functions.
333331

334-
|Key|Sample value|
335-
|---|------------|
336-
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`1`|
332+
|Key|Value|Description|
333+
|---|-----|-----------|
334+
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`true`|Treat entry point errors as blocking errors and log them in App Insights.|
335+
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`false`|Treat entry point errors as ignore-able warnings and don't log them in App Insights.|
337336

338337
## FUNCTIONS\_V2\_COMPATIBILITY\_MODE
339338

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`](./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.
49+
- Set the app setting `FUNCTIONS_NODE_BLOCK_ON_ENTRY_POINT_ERROR` to `true`. This setting is recommended for all model v4 apps and ensures that all entry point errors are visible in your application insights logs. For more information, see [App settings reference for Azure Functions](./functions-app-settings.md#functions_node_block_on_entry_point_error).
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)