Skip to content

Files

Latest commit

Jun 3, 2020
35c9d48 · Jun 3, 2020

History

History
57 lines (41 loc) · 1.67 KB

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

File metadata and controls

57 lines (41 loc) · 1.67 KB
author ms.service ms.topic ms.date ms.author
ggailey777
azure-functions
include
02/09/2020
glenga

Run the function locally

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

::: zone pivot="programming-language-csharp,programming-language-powershell,programming-language-javascript,programming-language-python"

func start

::: zone-end

::: zone pivot="programming-language-typescript"

npm install
npm start

::: zone-end

::: zone pivot="programming-language-java"

mvn clean package 
mvn azure-functions:run

::: zone-end

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 below, 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.

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

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

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