Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Azure Functions Durable (Python) — 2.x

azure-functions-durable is the Python SDK provider for Durable Azure Functions, built on top of the durabletask SDK.

[!NOTE] 2.x is a ground-up rewrite of the Durable Functions Python SDK on top of the durabletask runtime. It is currently a preview (beta) release; APIs may change before the stable 2.0.0.

Requirements

  • Python 3.13+
  • The decorator-based Azure Functions programming model (DFApp / Blueprint)

Installation

pip install azure-functions-durable

Overview

Author orchestrations, activities, and entities as Azure Functions and let the Durable Task runtime handle scheduling, checkpointing, and replay. Both durabletask-native two-argument functions (def orchestrator(ctx, input)) and v1-style single-argument functions (def orchestrator(context)) are supported, along with class-based entities and a compatibility layer over the v1 API.

Key capabilities include durable orchestrations and sub-orchestrations, durable timers, external events, durable entities, retries, versioning, durable HTTP calls (context.call_http(...)), recurring scheduled tasks, and history export.

Unit testing entities

Use execute_entity() to run one entity operation in-process without a Functions host or Durable Task backend. It supports v1-style entity functions, durabletask-native entity functions, and DurableEntity subclasses:

from azure.durable_functions.testing import execute_entity
from durabletask.entities import DurableEntity


class Counter(DurableEntity):
    def add(self, amount: int) -> int:
        value = self.get_state(int, 0) + amount
        self.set_state(value)
        return value


outcome = execute_entity(Counter, "add", input=2, state=3)

assert outcome.get_result() == 5
assert outcome.get_state() == 5
assert outcome.actions == ()

For an entity_trigger-decorated function, pass the exposed entity function:

import azure.durable_functions as df
from azure.durable_functions.testing import execute_entity


app = df.DFApp()


@app.entity_trigger(context_name="context")
def counter(context: df.DurableEntityContext) -> None:
    value = context.get_state(initializer=lambda: 0)
    value += context.get_input()
    context.set_state(value)
    context.set_result(value)


entity_function = counter.build().get_user_function().entity_function
outcome = execute_entity(entity_function, "add", input=2, state=3)

assert outcome.get_result() == 5
assert outcome.get_state() == 5

The returned EntityTestResult provides get_result() and get_state() methods plus typed signal or orchestration-start actions scheduled by the operation. Pass expected_type when reconstructing a custom payload:

assert outcome.get_state(expected_type=CounterState) == CounterState(value=5)

Links

License

Licensed under the MIT License.

Release files for azure-functions-durable 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azure-functions-durable 2.0.0rc1
File Size Uploaded
azure_functions_durable-2.0.0rc1.tar.gz 54.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for azure-functions-durable 2.0.0rc1
File Interpreter ABI Platform
azure_functions_durable-2.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 124.1 kB

Release files / azure_functions_durable-2.0.0rc1.tar.gz

Download URL azure_functions_durable-2.0.0rc1.tar.gz
Size 54.6 kB
Tags Source
SHA-256 checksum
How to use checksums
28f325e26d05a993c1d6644712500793fd1df0f261231198a5635107c2cb1a12
BLAKE2b-256 checksum
How to use checksums
9bd4ee8230ecdbba0a57470196e231a8ebcb4c9d5ad0da0dd5cc107385a4d864
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / azure_functions_durable-2.0.0rc1-py3-none-any.whl

Download URL azure_functions_durable-2.0.0rc1-py3-none-any.whl
Size 69.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26794dcbdfb4e9ad35c4478676e8ae8f553f572f7206eb58b85ccfb3ff939584
BLAKE2b-256 checksum
How to use checksums
f631270b81f2a04699fa1d8c2381910e39f6f4081d2a1bcc9f9d0989d17ea43f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release history Release notifications | RSS feed

This release

2.0.0rc1 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page