Skip to content

Commit 6814730

Browse files
Merge pull request #97 from anthonychu/20200328-update-readme-devcontainer
Update readme with limitations, quickstart link
2 parents 77bca2d + 15ca68d commit 6814730

File tree

1 file changed

+28
-56
lines changed

1 file changed

+28
-56
lines changed

README.md

Lines changed: 28 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Durable Functions for Python
77

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:
99

1010
* Define workflows in code. No JSON schemas or designers are needed.
1111
* 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
2525

2626
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)
2727

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
3629

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.
3831

39-
3. Install the Durable Functions extension
40-
41-
Run this command from the root folder of your Azure Functions app:
42-
```bash
43-
func extensions install -p Microsoft.Azure.WebJobs.Extensions.DurableTask -v 1.8.3
44-
```
32+
### Functionality
4533

46-
**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))
4737

48-
4. Install the `azure-durable-functions` pip package at the root of your function app:
38+
### Tooling
4939

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.
5541

56-
```bash
57-
pip install azure-durable-functions
58-
```
42+
### Deployment
5943

60-
5. Write an activity function ([see sample](./samples/python_durable_bindings/DurableActivity)):
61-
```python
62-
def main(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)
6645

67-
6. Write an orchestrator function ([see sample](./samples/python_durable_bindings/DurableOrchestrationTrigger)):
46+
## Getting Started
6847

69-
```python
70-
def main(context: str):
71-
orchestrate = df.Orchestrator.create(generator_function)
72-
result = orchestrate(context)
73-
return result
74-
```
48+
Follow these instructions to get started with Durable Functions in Python:
7549

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)
50+
**🚀 [Python Durable Functions quickstart](https://aka.ms/pythondurable)**
7751

78-
7. Write your client function ([see sample](./samples/DurableOrchestrationClient/)):
52+
## Samples
7953

80-
TBD
54+
Take a look at this project's [samples directory](./samples/):
8155

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)
56+
* [Function Chaining](./samples/function_chaining)
57+
* [Fan-out/Fan-in - Simple](./samples/fan_out_fan_in)
58+
* [Fan-out/Fan-in - TensorFlow](./samples/fan_out_fan_in_tensorflow)
59+
* [External Events - Human Interaction & Timeouts](./samples/external_events)
8360

84-
## Samples
61+
### Orchestrator example
8562

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:
63+
```python
64+
import azure.durable_functions as df
8765

88-
* [Function Chaining - Hello Sequence](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-sequence)
89-
* [Fan-out/Fan-in - Cloud Backup](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-cloud-backup)
90-
* [Monitors - Weather Watcher](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-monitor)
91-
* [Human Interaction & Timeouts - Phone Verification](https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-phone-verification)
9266

93-
```python
94-
def generator_function(context):
95-
outputs = []
67+
def orchestrator_function(context: df.DurableOrchestrationContext):
9668
task1 = yield context.call_activity("DurableActivity", "One")
9769
task2 = yield context.call_activity("DurableActivity", "Two")
9870
task3 = yield context.call_activity("DurableActivity", "Three")
9971

100-
outputs.append(task1)
101-
outputs.append(task2)
102-
outputs.append(task3)
103-
72+
outputs = [task1, task2, task3]
10473
return outputs
74+
75+
76+
main = df.Orchestrator.create(orchestrator_function)
10577
```

0 commit comments

Comments
 (0)