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
@@ -50,27 +50,20 @@ Before you begin, you must have the following prerequisites:
50
50
In Azure Functions, a function project is a container for one or more individual functions that each responds to a specific trigger. All functions in a project share the same local and hosting configurations. In this section, you create a function project that contains a single function.
51
51
52
52
::: zone pivot="nodejs-model-v3"
53
-
1. Run the `func init` command, as follows, to create a functions project in a folder named *LocalFunctionProj* with the specified runtime:
53
+
In a suitable folder, run the [`func init`](functions-core-tools-reference.md#func-init) command, as follows, to create a TypeScript Node.js v3 project in the current folder:
54
54
55
55
```console
56
-
func init LocalFunctionProj --typescript
56
+
func init --typescript --model V3
57
57
```
58
-
59
-
2. Navigate into the project folder:
60
-
61
-
```console
62
-
cd LocalFunctionProj
63
-
```
64
-
65
-
This folder contains various files for the project, including configurations files named [local.settings.json](functions-develop-local.md#local-settings-file) and [host.json](functions-host-json.md). Because *local.settings.json* can contain secrets downloaded from Azure, the file is excluded from source control by default in the *.gitignore* file.
58
+
This folder now contains various files for the project, including configurations files named [local.settings.json](functions-develop-local.md#local-settings-file) and [host.json](functions-host-json.md). Because *local.settings.json* can contain secrets downloaded from Azure, the file is excluded from source control by default in the *.gitignore* file.
66
59
67
60
3. Add a function to your project by using the following command, where the `--name` argument is the unique name of your function (HttpExample) and the `--template` argument specifies the function's trigger (HTTP).
68
61
69
62
```console
70
63
func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
71
64
```
72
65
73
-
`func new` creates a subfolder matching the function name that contains a code file appropriate to the project's chosen language and a configuration file named *function.json*.
66
+
[`func new`](functions-core-tools-reference.md#func-new) creates a subfolder matching the function name that contains a code file appropriate to the project's chosen language and a configuration file named *function.json*.
74
67
75
68
### (Optional) Examine the file contents
76
69
@@ -95,31 +88,21 @@ Each binding requires a direction, a type, and a unique name. The HTTP trigger h
95
88
::: zone-end
96
89
97
90
::: zone pivot="nodejs-model-v4"
98
-
1. Run the `func init` command, as follows, to create a functions project in a folder named *LocalFunctionProj* with the V4 programming model:
99
-
100
-
```console
101
-
func init LocalFunctionProj --model V4
102
-
```
103
-
104
-
You're then prompted to choose a worker runtime and a language - choose Node for the first and TypeScript for the second.
105
-
106
-
2. Navigate into the project folder:
91
+
1. In a suitable folder, run the [`func init`](functions-core-tools-reference.md#func-init) command, as follows, to create a TypeScript Node.js v4 project in the current folder:
107
92
108
93
```console
109
-
cd LocalFunctionProj
94
+
func init --typescript
110
95
```
111
96
112
-
This folder contains various files for the project, including configurations files named *local.settings.json* and *host.json*. Because *local.settings.json* can contain secrets downloaded from Azure, the file is excluded from source control by default in the *.gitignore* file.
97
+
This folder now contains various files for the project, including configurations files named *local.settings.json* and *host.json*. Because *local.settings.json* can contain secrets downloaded from Azure, the file is excluded from source control by default in the *.gitignore* file. Required npm packages are also installed in *node_modules*.
113
98
114
-
3. Add a function to your project by using the following command:
99
+
1. Add a function to your project by using the following command, where the `--name` argument is the unique name of your function (HttpExample) and the `--template` argument specifies the function's trigger (HTTP).
115
100
116
101
```console
117
-
func new
102
+
func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
118
103
```
119
104
120
-
Choose the template for "HTTP trigger". You can keep the default name (*httpTrigger*) or give it a new name (*HttpExample*). Your function name must be unique, or you're asked to confirm if your intention is to replace an existing function.
121
-
122
-
You can find the function you added in the *src/functions* directory.
105
+
[`func new`](functions-core-tools-reference.md#func-new) creates a file named *HttpExample.ts* in the *src/functions* directory, which contains your function's code.
123
106
124
107
4. Add Azure Storage connection information in *local.settings.json*.
0 commit comments