1.3 KiB
1.3 KiB
Install dependencies
https://github.com/Azure/azure-functions-core-tools
and the VS Code extension called Azure Functions
Run
Run either with Run/Start Debugging
or npm start
or func host start
from the command line
Interesting parts
A Function app normally runs on URL http://localhost:7071/api/<function-endpoint>
host.json
, this sets theroutePrefix
to empty string which means that the base URL is nowhttp://localhost:7071/
Every function is built up of a directory looking like so:
--| <function-endpoint>
----| function.json
----| index.js
function.json
, this the configuration that set's up the functionauthLevel
, this decided whether the user needs an API key or not, possible valuesanonymous
,function
,admin
type
, how the function is triggered, can be many things like a queue message a DB row etc, in this case it's ahttpTrigger
direction
, this says whether this is incoming data or outgoing. We can for example have an incoming HTTP message but an outgoing DB row (we write to a DB). Read more about this on bindingsname
, name of the request/response object depending onmethods
, this is an array of supported methodsroute
, this sets up what routing pattern we respond on