File size: 1,596 Bytes
ebffcb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
Order: 3
Area: functions
TOCTitle: Create a Function
PageTitle: Create a Function
MetaDescription: Try Azure Functions for free with Visual Studio Code
DateApproved: 2/9/2018
---
# Add a Function to your App

Next, create a Function that handles HTTP requests.

From the **AZURE FUNCTIONS** explorer, click the **Create Function** icon.

![Create Function](images/functions-extension/create-function.png)

Select the directory you currently have open - it's the default option so press `kbstyle(Enter)`. When prompted, choose HTTP trigger, use the default name of `HttpTriggerJS`, and choose **Anonymous** authentication.

![Choose Template](images/functions-extension/create-function-choose-template.png)

![Choose Authentication](images/functions-extension/create-function-anonymous-auth.png)

Upon completion, a new directory is created within your Function app named `HttpTriggerJS` that includes `index.js`and `functions.json` files. The `index.js` file contains the source code that responds to the HTTP request and `functions.json` contains the [binding configuration](https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings) for the HTTP trigger.

![Completed Project](images/functions-extension/functions-vscode-intro.png)

Next, run your app locally to verify everything is working.

---

<a class="tutorial-next-btn" href="/tutorials/functions-extension/run-app">I created the Functions App</a> <a class="tutorial-feedback-btn" onclick="reportIssue('node-deployment-azurefunctions', 'create-function')" href="javascript:void(0)">I ran into an issue</a>