Skip to content

Files

Latest commit

Apr 2, 2021
7a7efaf · Apr 2, 2021

History

History
37 lines (25 loc) · 1.31 KB

functions-run-function-test-local-cli.md

File metadata and controls

37 lines (25 loc) · 1.31 KB
author ms.service ms.topic ms.date ms.author
ggailey777
azure-functions
include
10/18/2020
glenga

Run the function locally

  1. Run your function by starting the local Azure Functions runtime host from the LocalFunctionProj folder:

    func start
    

    Toward the end of the output, the following lines should appear:

     ...
     
     Now listening on: http://0.0.0.0:7071
     Application started. Press Ctrl+C to shut down.
     
     Http Functions:
     
             HttpExample: [GET,POST] http://localhost:7071/api/HttpExample
     ...
     
     

    [!NOTE]
    If HttpExample doesn't appear as shown above, you likely started the host from outside the root folder of the project. In that case, use Ctrl+C to stop the host, navigate to the project's root folder, and run the previous command again.

  2. Copy the URL of your HttpExample function from this output to a browser and append the query string ?name=<YOUR_NAME>, making the full URL like http://localhost:7071/api/HttpExample?name=Functions. The browser should display a response message that echoes back your query string value. The terminal in which you started your project also shows log output as you make requests.

  3. When you're done, use Ctrl+C and choose y to stop the functions host.