- Visual Studio Code
- Brew (if using MacOS)
- Yarn
- Node.js 18
- Azure Functions Core Tools
- Postman
- Download the following extensions for VSCode
- Add
local.settings.json
file
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}
- Run
yarn install
to add all dependencies in package.json
Before running your app locally, you need to run the storage emulator.
- Select Azure Icon in activity bar on the left in your VSCode window.
- Select Attached Storage Accounts
- Select Local Emulator
- Select Blob Containers, Queues, and Tables
- Under each one, click Start
Once you have the storage emulator running, you can run yarn start
to get the app running.
Make a POST request to http://localhost:7071/api/hello
Example request body:
{
"name": "Jonah"
}
Example response:
{
"id": "b9614b54ebba42039d9549d862810223",
"statusQueryGetUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223?taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"sendEventPostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/raiseEvent/{eventName}?taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"terminatePostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/terminate?reason={text}&taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"rewindPostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/rewind?reason={text}&taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"purgeHistoryDeleteUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223?taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"restartPostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/restart?taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"suspendPostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/suspend?reason={text}&taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw==",
"resumePostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/b9614b54ebba42039d9549d862810223/resume?reason={text}&taskHub=TestHubName&connection=Storage&code=tTORLBOAUHGq2njI_CdhXu_nSkpWkLY9uiYne6MwrsJ3AzFugZWrdw=="
}
Make a GET request to the statusQueryGetUri
Example response:
{
"name": "helloOrchestrator",
"instanceId": "b9614b54ebba42039d9549d862810223",
"runtimeStatus": "Completed",
"input": {
"name": "Jonah"
},
"customStatus": null,
"output": [
"Hello, Tokyo",
"Hello, Seattle",
"Hello, Cairo",
"Hello, Jonah"
],
"createdTime": "2023-10-04T01:33:51Z",
"lastUpdatedTime": "2023-10-04T01:33:52Z"
}