Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.8 KB

functions-run-function-test-local-vs-code.md

File metadata and controls

28 lines (18 loc) · 1.8 KB
author ms.service ms.topic ms.date ms.custom ms.author
ggailey777
azure-functions
include
06/15/2022
devdivchpfy22
glenga

Run the function locally

Visual Studio Code integrates with Azure Functions Core tools to let you run this project on your local development computer before you publish to Azure.

  1. To start the function locally, press F5 or the Run and Debug icon in the left-hand side Activity bar. The Terminal panel displays the Output from Core Tools. Your app starts in the Terminal panel. You can see the URL endpoint of your HTTP-triggered function running locally.

    :::image type="content" source="./media/functions-run-function-test-local-vs-code/functions-vscode-f5.png" alt-text="Screenshot of the Local function VS Code output.":::

    If you have trouble running on Windows, make sure that the default terminal for Visual Studio Code isn't set to WSL Bash.

  2. With Core Tools still running in Terminal, choose the Azure icon in the activity bar. In the Workspace area, expand Local Project > Functions. Right-click (Windows) or Ctrl - click (macOS) the new function and choose Execute Function Now....

    Execute function now from Visual Studio Code

  3. In Enter request body you see the request message body value of { "name": "Azure" }. Press Enter to send this request message to your function.

  4. When the function executes locally and returns a response, a notification is raised in Visual Studio Code. Information about the function execution is shown in Terminal panel.

  5. With the Terminal panel focused, press Ctrl + C to stop Core Tools and disconnect the debugger.