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-node-upgrade-v4.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,28 @@
1
1
---
2
-
title: Upgrade to Azure Functions Node.js programming model v4
2
+
title: Upgrade to v4 of the Node.js model for Azure Functions
3
3
description: This article shows you how to upgrade your existing function apps running on v3 of the Node.js programming model to v4.
4
4
ms.service: azure-functions
5
5
ms.date: 03/15/2023
6
6
ms.devlang: javascript, typescript
7
7
ms.topic: how-to
8
8
---
9
9
10
-
# Upgrade to Azure Functions Node.js programming model v4
10
+
# Upgrade to version 4 of the Node.js programming model for Azure Functions
11
11
12
12
The Node.js programming model for Azure Functions defines how you author serverless code in JavaScript or TypeScript. The version of the programming model matches the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package that should be included with your app. This article discusses the differences between both versions and how to upgrade an existing v3 app. If you want to create a brand new v4 app, see the tutorial for either [VS Code](./create-first-function-cli-node.md) or [Azure Functions Core Tools](./create-first-function-vs-code-node.md).
13
13
14
-
> [!NOTE]
15
-
> v4 of the Node.js programming model is currently in public preview. This version number is _not_ the same thing as the Azure Functions [runtime version](./functions-versions.md), which is coincidentally using "4" as its latest major version. Lastly, you can't mix v3 and v4 of the programming models.
16
-
17
-
## Motivation
18
-
19
-
v4 was designed with the following goals in mind:
14
+
Version 4 was designed with the following goals in mind:
20
15
21
16
- Provide a familiar and intuitive experience to Node.js developers
22
17
- Make the file structure flexible with support for full customization
23
18
- Switch to a code-centric approach for defining function configuration
24
19
25
-
## Prerequisites
20
+
> [!NOTE]
21
+
> v4 of the Node.js programming model is currently in public preview. This version number is _not_ the same thing as the Azure Functions [runtime version](./functions-versions.md), which is coincidentally using "4" as its latest major version. Lastly, you can't mix v3 and v4 of the programming models.
22
+
23
+
## Requirements
26
24
27
-
Before you start upgrading your app, v4 of the Node.js programming model is only supported with the following minimum versions:
25
+
Version 4 of the Node.js programming model requires the following minimum versions:
@@ -44,7 +42,7 @@ For the first time, the [`@azure/functions`](https://www.npmjs.com/package/@azur
44
42
45
43
## App entry point
46
44
47
-
v4 of the programming model lets you structure your code however you want. The only files you need at the root of your app are `host.json` and `package.json`. Otherwise, you define the file structure by setting the `main` field in your `package.json` file. The `main` field can be set to a single file or multiple files by using a [glob pattern](https://wikipedia.org/wiki/Glob_(programming)). Common values for the `main` field may be:
45
+
In v4 of the programming model, you can structure your code however you want. The only files you need at the root of your app are `host.json` and `package.json`. Otherwise, you define the file structure by setting the `main` field in your `package.json` file. The `main` field can be set to a single file or multiple files by using a [glob pattern](https://wikipedia.org/wiki/Glob_(programming)). Common values for the `main` field may be:
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-node.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,14 @@ As a JavaScript developer, you might also be interested in one of the following
23
23
| -- | -- | -- |
24
24
| <ul><li>[Node.js function using Visual Studio Code](./create-first-function-vs-code-node.md)</li><li>[Node.js function with terminal/command prompt](./create-first-function-cli-node.md)</li><li>[Node.js function using the Azure portal](functions-create-function-app-portal.md)</li></ul> | <ul><li>[Developer guide](functions-reference.md)</li><li>[Hosting options](functions-scale.md)</li><li>[TypeScript functions](#typescript)</li><li>[Performance considerations](functions-best-practices.md)</li></ul> | <ul><li>[Create serverless applications](/training/paths/create-serverless-applications/)</li><li>[Refactor Node.js and Express APIs to Serverless APIs](/training/modules/shift-nodejs-express-apis-serverless/)</li></ul> |
25
25
26
-
## Programming Model
26
+
## Programming model
27
27
28
28
The "programming model" as discussed in this article loosely represents the Node.js layer of Azure Functions. If you are authoring code in JavaScript or TypeScript, the code patterns you use are governed by the programming model. For example, it defines how you register a function, get a function's input, or interact with the invocation context. 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 _not_ the same thing as the Azure Functions [runtime version](./functions-versions.md), even if the major version numbers are coincidentally similar.
29
29
30
30
> [!NOTE]
31
31
> You can only use one major version of the programming model at a time.
32
32
33
-
### Supported Versions
33
+
### Supported versions
34
34
35
35
The following table shows each version of the Node.js programming model along with its supported versions of the Azure Functions runtime and Node.js.
0 commit comments