Skip to main content

Durable Functions For Python

Project description

Branch Status
master Build Status
dev Build Status

Durable Functions for Python

The azure-functions-durable pip package allows you to write Durable Functions for Python. Durable Functions is an extension of Azure Functions that lets you write stateful functions and workflows in a serverless environment. The extension manages state, checkpoints, and restarts for you. Durable Functions' advantages include:

  • Define workflows in code. No JSON schemas or designers are needed.
  • Call other functions synchronously and asynchronously. Output from called functions can be saved to local variables.
  • Automatically checkpoint progress whenever the function schedules async work. Local state is never lost if the process recycles or the VM reboots.

You can find more information at the following links:

A durable function, or orchestration, is a solution made up of different types of Azure Functions:

  • Activity: the functions and tasks being orchestrated by your workflow.
  • Orchestrator: a function that describes the way and order actions are executed in code.
  • Client: the entry point for creating an instance of a durable orchestration.

Durable Functions' function types and features are documented in-depth here.

Current limitations

We're actively working on Python support for Durable Functions and we expect a Public Preview announcement in Q2 CY2020. The following are the current known limitations.

Functionality

  • DurableOrchestrationContext.create_timer() is not yet supported (coming soon #35)
  • Sub-orchestrations are not yet supported (planned #62)
  • Durable Entities are not yet supported (not yet planned #96)

Tooling

  • Python Durable Functions requires updated versions of Azure Functions Core Tools that includes Python worker 1.1.0, templates (bundle-1.2.0), and extension bundles (1.2.0) that are not yet released (ETA May 2020). Use the VS Code dev container in the Getting Started section to access a development environment with the required versions of the tools installed.

Deployment

  • Python Durable Functions requires an updated version of the Azure Functions Python language worker (1.1.0) that is not yet available in Azure. Deploy your Python Durable Functions apps in containers (requires Premium or App Service plans). (Linux consumption plan support ETA May 2020)

Getting Started

Follow these instructions to get started with Durable Functions in Python:

🚀 Python Durable Functions quickstart

Samples

Take a look at this project's samples directory:

Orchestrator example

import azure.durable_functions as df


def orchestrator_function(context: df.DurableOrchestrationContext):
    task1 = yield context.call_activity("DurableActivity", "One")
    task2 = yield context.call_activity("DurableActivity", "Two")
    task3 = yield context.call_activity("DurableActivity", "Three")

    outputs = [task1, task2, task3]
    return outputs


main = df.Orchestrator.create(orchestrator_function)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure-functions-durable-1.0.0b6.tar.gz (4.8 MB view details)

Uploaded Source

Built Distribution

azure_functions_durable-1.0.0b6-py3-none-any.whl (68.1 kB view details)

Uploaded Python 3

File details

Details for the file azure-functions-durable-1.0.0b6.tar.gz.

File metadata

  • Download URL: azure-functions-durable-1.0.0b6.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.17

File hashes

Hashes for azure-functions-durable-1.0.0b6.tar.gz
Algorithm Hash digest
SHA256 76099d5b5cd6113f41a3fd8cd3de7c418c5783585cbb13203bd11019c6ac6218
MD5 1de87236c29c2e99a20c6ef837e5b32b
BLAKE2b-256 b7f77401adc08ccbd07ff6bbccc135faf8388ef014bbc35190a0f2c5872fbc1d

See more details on using hashes here.

File details

Details for the file azure_functions_durable-1.0.0b6-py3-none-any.whl.

File metadata

  • Download URL: azure_functions_durable-1.0.0b6-py3-none-any.whl
  • Upload date:
  • Size: 68.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.17

File hashes

Hashes for azure_functions_durable-1.0.0b6-py3-none-any.whl
Algorithm Hash digest
SHA256 481fe2f54fdbd470df68739928ec0505dc7949184cd6c72ebfbfeea9776000df
MD5 20ea02a23b05fab71cf0f23d6fb2498c
BLAKE2b-256 ffc17592ae4f3f112c11924f3109f9b1f2b5355bc9c694749f8a458ed652820d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page