Skip to content

Add durable functions support #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 28, 2020
Merged

Add durable functions support #623

merged 5 commits into from
Feb 28, 2020

Conversation

Hazhzeng
Copy link
Contributor

@Hazhzeng Hazhzeng commented Feb 21, 2020

Background

We want to enable durable functions in Azure Functions Python Worker.
Previously, we are blocked by the implicit return from the generic binding.
The solution in this PR is to define a rich binding for OrchestrationTrigger and allow implicit returns from the trigger.

Depends On

Azure/azure-functions-python-library#48
CI is failing due to dependencies on azure-functions-python-library

Resolves

resolves: #608
resolves: #227

Usage

// function.json
{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "name": "orctx",
      "type": "orchestrationTrigger",
      "direction": "in"
    }
  ],
  "disabled": false
}
# main.py
def main(orctx: func.OrchestrationContext):
    orchestrate = df.Orchestrator.create(generator_function)
    result = orchestrate(orctx.body)
    return result

@Hazhzeng Hazhzeng changed the title Add durable functions support [WIP] Add durable functions support Feb 21, 2020
@Hazhzeng Hazhzeng changed the title [WIP] Add durable functions support Add durable functions support Feb 21, 2020
Copy link
Member

@scgbear scgbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing tests due to a dependence on the python-library changes?

@Hazhzeng
Copy link
Contributor Author

@scgbear Yes, this is due to dependency on azure-functions-python-library

@asedighi
Copy link

i verified the code with @Hazhzeng and tested the faninfanout sample with durable + retry. I confirmed that it worked.

@Hazhzeng Hazhzeng merged commit 97b5d89 into dev Feb 28, 2020
@Hazhzeng Hazhzeng deleted the hazeng/durable branch April 29, 2020 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error due to output binding checks in dispatcher.py Durable Functions Support for Python
4 participants