The solution consists of two projects:
- DurableFunctions.Demo.DotNetCore, a Function App targeted at .NET Core 2.1.
- DurableFunctions.Demo.DotNetCore.Test, an xUnit test project targeted at .NET Core 2.1.
The current version of this Function App depends on the free (and fun) external SWAPI in order to demonstrate function chaining and fan-out/fan-in patterns. This API doesn't require any authentication which makes it easier to demo and experiment with. The chaining and fan-out/fan-in functions can even run without any connection to the internet when the
SkipRemoteSwapi setting in local.settings.json is set to
true (it is then limited to using some hardcoded values).
The Function App solution consists of the following demos (found in seperate solution folders) which can be executed independently.
Run the solution and use the requests in HelloWorld.http to start the orchestration locally.
Run the Function App locally and use the requests in HelloName.http to start the orchestration.
The orchestration function requires a (partial) name of a Star Wars character. This character is searched in the
SearchCharacter activity which uses the
swapi.co API. When a character is returned the
GetPlanet activity is called (also uses
swapi.co again) to return the name of the home planet of the character. The full name of the character and the planet are returned from the orchestration.
Run the solution and use the requests in GetCharacterInfo.http to start the orchestration locally.
The orchestration function requires a (partial) name of a Star Wars planet. This planet is searched in the
SearchPlanet activity which uses the
swapi.co API. When a planet is returned the
GetCharacter activity is called for each of the residents found in the
SearchPlanet result. The full name of the planet and the names of the planet residents are returned from the orchestration.
Run the solution and use the requests in GetPlanetResidents.http to start the orchestration locally.
Some unit tests are added to verify the fan-out/fan-in orchestration. These tests are using xUnit, Moq (for mocking the
DurableOrchestrationContextBase), AutoFixture for generating testdata and FluentAssertions for... right, the fluent assertions :).
Using the VS Code REST Client
My blog posts & videos with more info about Durable Functions.
Some of these are getting outdated now...
Feel free to leave questions or comments here as GitHub issues so I can keep track of them.