This code repository contains a HTTP-triggered Azure durable function orchestartor that orchestrates an activity function. WIthin the activitiy function a durable entity is used that serves as stateful memory.
Make sure that all requirements for local development of durable functions are fulfilled as described in the official documentation.
In addition I installed the extensions not via Extension Bundle but used the func install
option i. e. func extensions install -p Microsoft.Azure.WebJobs.Extensions.DurableTask -v 2.1.0
. (reason, see below)
If you set up the function projetct yourself via Visual Studio Code, make sure to adjust the code as follows due to the fact that the templates are not up to date (status 23.12.2019):
- Remove the reference to the extension bundle from the
host.json
file - Adjust the binding in the HTTP orchestration starter to
durableClient
and notorchestrationClient
as the later is no longer valid for version 2.0 of Azure Functions and the durabel extension
- Start the function locally via
npm run start
- Use the REST client/CLI you like and trigger the orchestration via a GET request at
http://localhost:7071/api/orchestrators/DurableFunctionsOrchestratorJS
. This will trigger a sequence of execution of actions. Each action execution is memorized in the durable entity. So the counter of the memory will increase with every action execution independent if this is done in one execution cycle of the orchestrator.
The following mismatch with respect to the current official documentation exists :
- The extensions are not installed via extension bundle as the extension
entityTrigger
is not recognized (which is consistent with the extension bundle JSON ), but viafunc install
. This is current state of the art as described in the release notes of version 2.1.0 - The binding of the EntityClient is an inbound binding as it would be for a OrchestrationClient. The documentation is not consistent here. It is ambivalent if you use in- or outbound binding, but I would stick to the status quo of the orchestration client
If you do local development you might want to purge the history in your local Azure storage emulator. To do so key in the command AzureStorageEmulator.exe clear all
- and do not forget the all
, not that taht ever happended to me ;-)
- Tested with Function runtime V3 (nodeJS 12 LTS) and Durable Extension 2.2.0
- Added file
RESTcalls.http
. This way you can use the REST client of Visual Studio Code to issue the calls