What are Durable Functions in Azure?

Durable Functions are long-running, serverless functions with a stateful architecture. They are used where the duration between function calls vary.

An example of durable function architecture is a file upload system with admin verification. If we want to upload some files to Azure Blob Storage and then have an admin verify valid files, we could make use of Durable Functions. The admin verification process could span over a couple of days or a few minutes. After the verification is complete, another function that compresses the valid files could run.

widget

Where are Durable Functions applied?

  1. When future running functions need to receive input from past functions
  2. A human agent input is required
  3. When writing event-driven code where external operations must be carried out before certain functions are run.

Durable Function Types

Client

Client functions are the standard Azure Functions that serve as the entry point of a durable function workflow. These client functions run in response to triggers such as HTTP, Blob Storage, and Timer.

Orchestrator

Orchestrator functions describe how durable function workflow actions are executed.

Entity

Entity functions define operations for modifying and reading small pieces of state. Much like Orchestrator function types, entity functions have a triggerin this case, an entity trigger. Entity functions can be triggered in Client or Orchestrator functions to control or read a small piece of state.

Activity

Activity functions are the actions that are executed by the durable function workflow. An activity is the basic unit of work that contains executable code.

Free Resources