This repository contains a sample app for the new Node.js Programming Model. The default "main" branch uses TypeScript, but you may switch to the "main-js" branch for the same app using just JavaScript.
Version 4 is currently in public preview! 🎉✨ Try it out and let us know what you think: https://aka.ms/AzFuncNodeV4
See here
-
Clone this repository
-
Add a
local.settings.jsonfile with the following contents:{ "IsEncrypted": false, "Values": { "FUNCTIONS_WORKER_RUNTIME": "node", "AzureWebJobsFeatureFlags": "EnableWorkerIndexing", "AzureWebJobsStorage": "<INSERT CONNECTION STRING HERE>" } } -
Add a connection string to the
AzureWebJobsStoragesetting in yourlocal.settings.json. You may set it toUseDevelopmentStorage=trueto use the local storage emulator or you may set it to a connection string for a storage account in Azure. -
Run
npm install -
Run
npm start -
Voila ✨ you have a running function app!
The default configuration in this repository only enables an http and timer trigger. Follow these steps to enable more functions:
-
Change the
mainfield in yourpackage.jsontodist/src/functions/*.js -
Add the following entries to the "Values" object in your
local.settings.json:"storage_APPSETTING": "", "cosmosDB_APPSETTING": "", "serviceBus_APPSETTING": "", "eventHub_APPSETTING": ""
-
Fill in the value of the above entries with a connection string for the specific type of resource you want to try out. You can skip any resource you do not want to use
-
Run
npm start! -
If you trigger the
helloWorldWithExtraOutputsfunction, it will set an output binding which triggers the other azure resource functions