lechnerc77 / AzureFunctionOrchestrationExtended

Azure Durable Functions including a classical orchestration of actions as well as using a durable entity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azure Orchestration with Activities and a Durable Entity

Content

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.

Setup

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 not orchestrationClient as the later is no longer valid for version 2.0 of Azure Functions and the durabel extension

How to Call

  • 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.

Deviations from the official documentation (as of 23.12.2019)

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 via func 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

Clearing Local Azure Storage Emulator

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 ;-)

Updates

03/22/2020

  • 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

About

Azure Durable Functions including a classical orchestration of actions as well as using a durable entity

License:MIT License


Languages

Language:TypeScript 100.0%