Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.42 KB

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

File metadata and controls

41 lines (27 loc) · 1.42 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 message like Hello Functions:

    Result of the function run locally in the browser

  3. The terminal in which you started your project also shows log output as you make requests.

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