You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-56Lines changed: 28 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
# Durable Functions for Python
7
7
8
-
The `azure-functions-durable`[pip](https://pypi.org/project/azure-functions-durable/) package allows you to write [Durable Functions](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview) for Python(https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python). Durable Functions is an extension of [Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview) 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:
8
+
The `azure-functions-durable`[pip](https://pypi.org/project/azure-functions-durable/) package allows you to write [Durable Functions](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview) for [Python](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python). Durable Functions is an extension of [Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview) 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:
9
9
10
10
* Define workflows in code. No JSON schemas or designers are needed.
11
11
* Call other functions synchronously and asynchronously. Output from called functions can be saved to local variables.
@@ -25,81 +25,53 @@ A durable function, or _orchestration_, is a solution made up of different types
25
25
26
26
Durable Functions' function types and features are documented in-depth [here.](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-types-features-overview)
27
27
28
-
## Getting Started
29
-
30
-
You can follow the instructions below to get started with a function chaining example, or follow the general checklist below:
31
-
32
-
1. Install prerequisites:
33
-
-[Azure Functions Core Tools version 2.x](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#install-the-azure-functions-core-tools)
34
-
-[Azure Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator) (Windows) or an actual Azure storage account (Mac or Linux)
35
-
- Python 3.6 or later
28
+
## Current limitations
36
29
37
-
2.[Create an Azure Functions app.](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python)
30
+
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.
38
31
39
-
3. Install the Durable Functions extension
40
-
41
-
Run this command from the root folder of your Azure Functions app:
**durable-functions requires Microsoft.Azure.WebJobs.Extensions.DurableTask 1.7.0 or greater.**
34
+
*`DurableOrchestrationContext.create_timer()` is not yet supported (coming soon [#35](https://github.com/Azure/azure-functions-durable-python/issues/35))
35
+
* Sub-orchestrations are not yet supported (planned [#62](https://github.com/Azure/azure-functions-durable-python/issues/62))
36
+
* Durable Entities are not yet supported (not yet planned [#96](https://github.com/Azure/azure-functions-durable-python/issues/96))
47
37
48
-
4. Install the `azure-durable-functions` pip package at the root of your function app:
38
+
### Tooling
49
39
50
-
Create and activate virtual environment
51
-
```
52
-
python3 -m venv env
53
-
source env/bin/activate
54
-
```
40
+
* Python Durable Functions requires updated versions of Azure Functions Core Tools that includes Python worker [1.1.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/1.1.0), templates ([bundle-1.2.0](https://github.com/Azure/azure-functions-templates/releases/tag/bundle-1.2.0)), and extension bundles ([1.2.0](https://github.com/Azure/azure-functions-extension-bundles/releases/tag/1.2.0)) that are not yet released (ETA May 2020). Use the VS Code dev container in the [Getting Started](#getting-started) section to access a development environment with the required versions of the tools installed.
55
41
56
-
```bash
57
-
pip install azure-durable-functions
58
-
```
42
+
### Deployment
59
43
60
-
5. Write an activity function ([see sample](./samples/python_durable_bindings/DurableActivity)):
61
-
```python
62
-
defmain(name: str) -> str:
63
-
logging.info(f"Activity Triggered: {name}")
64
-
# your code here
65
-
```
44
+
* Python Durable Functions requires an updated version of the Azure Functions Python language worker ([1.1.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/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)
66
45
67
-
6. Write an orchestrator function ([see sample](./samples/python_durable_bindings/DurableOrchestrationTrigger)):
Follow these instructions to get started with Durable Functions in Python:
75
49
76
-
**Note:** Orchestrator functions must follow certain [code constraints.](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-checkpointing-and-replay#orchestrator-code-constraints)
7. Write your client function ([see sample](./samples/DurableOrchestrationClient/)):
52
+
## Samples
79
53
80
-
TBD
54
+
Take a look at this project's [samples directory](./samples/):
81
55
82
-
**Note:** Client functions are started by a trigger binding available in the Azure Functions 2.x major version. [Read more about trigger bindings and 2.x-supported bindings.](https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings#overview)
*[External Events - Human Interaction & Timeouts](./samples/external_events)
83
60
84
-
##Samples
61
+
### Orchestrator example
85
62
86
-
The [Durable Functions samples](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-install) demonstrate several common use cases. They are located in the [samples directory.](./samples/) Descriptive documentation is also available:
0 commit comments