0

Problem

How to add Azure Durable Functions to the Serverless framework.

Serverless Configuration (..trimmed)

event:
  orchestration-handler:
      handler: index.run
      events:
        - http: true
          name: req
          methods:
            - post
            - get
          route: orchestration-url

Expected Format

Required bidings for the durable function is

{
  "bindings": [
    {
      "authLevel": "anonymous",
      "name": "req",
      "type": "httpTrigger",
      "direction": "in",
      "route": "orchestrators/{functionName}",
      "methods": [
        "post",
        "get"
      ]
    },
    {
      "name": "$return",
      "type": "http",
      "direction": "out"
    },
    {
      "name": "starter",
      "type": "orchestrationClient",
      "direction": "in"
    }
  ],
  "scriptFile": "../dist/DurableFunctionsHttpStart/index.js"
}

Actual Result

But Serverless (.yml) framework generates only the following JSON file

{
  "disabled": false,
  "bindings": [
    {
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "route": "orchestration",
      "authLevel": "function",
      "methods": [
        "post",
        "get"
      ]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ],
  "entryPoint": "handler",
  "scriptFile": "../.webpack/service/src/handlers/orchestration/index.js"
}

You can see there is additional section in actual azure durable function.json file i.e

Missing Bindings

....
....
{
      "name": "starter",
      "type": "orchestrationClient",
      "direction": "in"
    }
....
....

Question

Does serverless framework support Durable functions?

I could not find any reference in an official document, GitHub or google search.

How to create the binding as mentioned above? Is there any workaround for that?

Aravin
  • 6,605
  • 5
  • 42
  • 58

0 Answers0