Skip to content

Companion repository for the "How to chain Azure Functions and leverage Durable Functions to reduce the burden when managing long-living serverless workloads" blog post

License

Notifications You must be signed in to change notification settings

ricardolsmendes/azure-durablefunctions-python

Repository files navigation

azure-durablefunctions-python

Companion repository for the How to chain Azure Functions and leverage Durable Functions to reduce the burden when managing long-living serverless workloads blog post, addressing technical facets of microservices orchestration under the Microsoft Azure umbrella with Azure Functions and Durable Functions.

The blog post brings implementation details that hopefully will help developers thrive when working with the Function Chaining and Async HTTP APIs application patterns.

Sample application

The dummy Funds Transfer App comprises 4 business steps, each of them implemented as an Azure Function:

N|Solid

Main characteristics:

  1. get-funds-transfer-data returns a value to the orchestrator;

  2. get-funds-transfer-data, validate-input, and handle-funds-transfer are mandatory and must run in this order;

  3. validate-internal-account is optional can execute between validate-input and handle-funds-transfer under certain conditions.

Quickstart guide

  1. Create an Azure Function using the Azure Portal.

  2. Clone this repo:

    git clone https://github.com/ricardolsmendes/azure-durablefunctions-python.git
  3. Publish the Azure Function:

    cd azure-durablefunctions-python || exit
    func azure functionapp publish <YOUR-FUNCTION-NAME>

    The HTTP URI will be displayed at the end of the publishing logs — replace {functionName} with transfer-funds.

  4. Use Postman or equivalent tool to make requests and see it in action. Please use the below content as a reference request body:

    {
      "metadata": {
        "requestId": "6d79dbfb",
        "requestType": "fundsTransfer"
      },
      "data": {
        "sourceAccount": {
          "id": "123456",
          "bankId": "001"
        },
        "targetAccount": {
          "id": "456789",
          "bankId": "002"
        }
      }
    }

    This will result in successful execution. The validation errors and optional execution path can be activated by applying slight changes to it:

    • remove data, data.sourceAccount, or data.targerAccount to see the validation errors;
    • change data.targetAccount.bankId to 001 to run validate-internal-account in a given workflow.

How to contribute

Please make sure to take a moment and read the Code of Conduct.

Report issues

Please report bugs and suggest features via the GitHub Issues.

Before opening an issue, search the tracker for possible duplicates. If you find a duplicate, please add a comment saying that you encountered the problem as well.

Contribute code

Please make sure to read the Contributing Guide before making a pull request.

About

Companion repository for the "How to chain Azure Functions and leverage Durable Functions to reduce the burden when managing long-living serverless workloads" blog post

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published