Take your Azure Functions to the next level with Durable Functions @ SDN 2019

Take your Azure Functions to the next level with Durable Functions @ SDN 2019

My slides for the presentation I gave during the Software Development Network event on April 12, 2019, in Zeist.

The source code is available at GitHub: https://github.com/marcduiker/demos-azure-durable-functions

Fd55de4174accaf3b4f030e43a8a70c6?s=128

Marc Duiker

April 12, 2019
Tweet

Transcript

  1. @marcduiker

  2. Marc Duiker Lead Azure Consultant @ Xpirit

  3. @marcduiker Durable Functions

  4. @marcduiker Durable Functions

  5. @marcduiker Durable Functions

  6. @marcduiker Durable Functions

  7. @marcduiker Durable Functions

  8. @marcduiker Durable Functions Multiple Functions & Control Flow

  9. @marcduiker Durable Functions

  10. @marcduiker Durable Functions

  11. @marcduiker Durable Functions

  12. @marcduiker Durable Functions

  13. @marcduiker Durable Functions

  14. @marcduiker Durable Functions

  15. @marcduiker Durable Functions

  16. @marcduiker Durable Functions Durable Functions is based on

  17. @marcduiker Durable Functions Function Roles

  18. @marcduiker Durable Functions Invocations, Checkpoints & Replay

  19. @marcduiker Durable Functions State is Persisted in Table Storage

  20. @marcduiker Durable Functions New Trigger Bindings [OrchestrationClient] DurableOrchestrationClient(Base) Function Role:

    Starter Function
  21. @marcduiker Durable Functions DurableOrchestrationClient

  22. @marcduiker Durable Functions New Trigger Bindings [OrchestrationTrigger] DurableOrchestrationContext(Base) Function Role:

    Orchestrator Function
  23. @marcduiker Durable Functions DurableOrchestrationContext

  24. @marcduiker Durable Functions New Trigger Bindings [ActivityTrigger] DurableActivityContext Function Role:

    Activity Function
  25. @marcduiker Durable Functions DurableActivityContext

  26. @marcduiker Durable Functions

  27. @marcduiker Durable Functions • Visual Studio 2017 15.7+ • Azure

    Workload • Extension: Azure Functions & Web Jobs Tools • Azure Storage Emulator • Nuget packages • Microsoft.NET.Sdk.Functions (1.0.26) • Microsoft.Azure.Webjobs.Extensions.DurableTask (1.8.0) Local development with VS2017/2019
  28. @marcduiker Durable Functions Hello {name} Demo! HttpStart HelloName Ochestrator {name}

    HelloName Activity {name}
  29. @marcduiker Durable Functions

  30. @marcduiker Durable Functions Function chaining

  31. @marcduiker Durable Functions Demo: Function Chaining Find a Star Wars

    character and return it’s: - Full name - Home planet - Species name - Species home planet. https://swapi.co/
  32. @marcduiker Durable Functions Demo: Function Chaining HttpStart GetCharacterInfo Orchestrator GetSpecies

    Activity GetPlanet Activity SearchCharacter Activity
  33. @marcduiker Durable Functions

  34. @marcduiker Durable Functions Fan-out/fan-in FA1 returns a collection of items

    FA2 is called for each of the items from FA1
  35. @marcduiker Durable Functions Demo: Fan-out/Fan-in Find a Star Wars planet

    and their residents. https://swapi.co/
  36. @marcduiker Durable Functions Demo: Fan-out/Fan-in HttpStart GetPlanetResidents Orchestrator GetCharacter Activity

    SearchPlanet Activity
  37. @marcduiker Durable Functions

  38. @marcduiker Durable Functions Unit Testing Demo Testing the GetPlanetResidents orchestrator

    using: • xUnit • Moq • AutoFixture
  39. @marcduiker Durable Functions

  40. @marcduiker Durable Functions • In and output of functions should

    be serializable. • Orchestration Functions should be deterministic. Don’t use: - DateTime.Now, use CurrentUtcDateTime - Guid.NewGuid() - Random generated data Closing remarks I
  41. @marcduiker Durable Functions • Orchestrator Functions can only call Activity

    Functions in the same Function App. • Keep your orchestrations small. • What changes together should be deployed together. Closing remarks II
  42. @marcduiker Durable Functions GitHub: demos-azure-durable-functions mduiker@xpirit.com blog.marcduiker.nl @marcduiker