Create the local Functions app

Previous step: Introduction and prerequisites

In this step, you create a local Azure Functions application that contains a function that uses an HTTP trigger. An Azure Functions app can contain many Functions with different triggers. The HTTP trigger specifically handles incoming HTTP traffic.

  1. From a terminal or command prompt, run Visual Studio Code from within a suitable folder for the project:

    # Create and navigate to a project folder
    
    # Run VS Code in that folder
    code .
    
  2. In VS Code, select the Azure logo to open the Azure Functions explorer, then select the Create Project command:

    Create a local Function app in VS Code

  3. At the first two prompts, select the current folder, then select JavaScript for the language.

  4. At the prompt, Select a template for your project's first function, select HTTP Trigger:

    Select the trigger for the Function

  5. At the prompt, Provide a function name, enter HttpExample. (Avoid using the default "HttpTrigger" name because it's the same as the trigger, which can be confusing.)

    Entering a function name

  6. At the prompt, Authorization Level, select Anonymous:

    Entering a function name

  7. After a few moments, VS Code completes creation of the project. You have a folder named for the function, HttpExample, within which are three files:

    Filename Description
    index.js The source code that responds to the HTTP request.
    functions.json The binding configuration for the HTTP trigger.
    sample.dat A placeholder data file to demonstrate that you can have other files in the folder. You can delete this file, if desired, as it's not used in this tutorial.

    Result of creating a function app