0

I'm running a set of durable functions (Node.js-written) on the Azure Function App platform.
Node version is 10, functions runtime is 2.
Some of them have triggers configured:

  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "post"
      ]
    },


{
  "bindings": [
    {
      "name": "name",
      "type": "activityTrigger",
      "direction": "in"
    }
  ],
  "scriptFile": "../.../index.js"
}

Since yesterday the function is showing the following error when trying to open it:

Function (func4/Create) Error: Microsoft.Azure.WebJobs.Host: Error indexing method  
 'Functions.Create'. Microsoft.Azure.WebJobs.Host: Can't bind parameter 'data' to type  
 'System.String'.
    Session Id: 9b3d1a97c12b4c86b751b08ab17c06da

Timestamp: 2019-12-11T19:04:49.345Z

I have no idea what is causing this behavior.
Kudu logs are also full of the same error but without details.

Updated (dependencies):

 "dependencies": {
    "axios": "^0.19.0",
    "durable-functions": "^1.3.1",
    "moment": "^2.24.0",
    "momentjs": "^2.0.0",
    "request": "^2.88.0",
    "request-promise-native": "^1.0.8",
    "xml-js": "^1.6.11"
  },
  "devDependencies": {
    "@azure/functions": "^1.0.2-beta2",
    "typescript": "^3.3.3"
  }
Sergey
  • 381
  • 6
  • 24

2 Answers2

3

The problem was in data noun which seems to be a reserved word in Azure Functions.
When I've changed the name from data to another one (context here) the error has gone:

{
  "bindings": [
    {
      "name": "context",
      "type": "activityTrigger",
      "direction": "in"
    }
  ],
  "scriptFile": "../dist/Container/index.js"
}

This information isn't documented anywhere unfortunately, I got the clue when trying to test different hypotheses.

Sergey
  • 381
  • 6
  • 24
  • 1
    There appears to be an open GitHub issue for this as well, for anyone interested: https://github.com/Azure/Azure-Functions/issues/1281 – Adam Weber Feb 20 '20 at 21:15
0

Please notice that Azure durable functions does not support typescript.

If you use JavaScript, it can support Azure durable functions.

Have a look of the Offical doc.

enter image description here

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27
  • Well, if you check the initial post, the function runtime is 2. Also, despite the function is written in typescript, the typescript compiler is executed prior to deployment and deployment files are the pure js. This error isn't connected to the assemblies in any case. – Sergey Dec 12 '19 at 13:29
  • @Sergey I am sorry for not noticing your runtime version, I modified my answer. Note, however, that your functions are still written in typescript. Have you ever written durable functions in typescript before? Unless there is a problem with the documentation, azure function app written except C #, JavaScript, and F# should not be able to implement durable functions. Python also not support durable functions. – Cindy Pau Dec 13 '19 at 09:34
  • Please look [here](https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages#languages-by-runtime-version).Typescript is supported as GA for 2.x runtime when compiled to Javascript (`Supported through transpiling to JavaScript.`). This is exactly what's happened when I run my npm build command (tsc compiler creates pure js files inside the 'dist' directory which is then deployed to Function App). – Sergey Dec 13 '19 at 22:41
  • @Sergey Hi, Sergey. Thank you very much for your explanation, my understanding of what azure durable function supports may be wrong. If you solve this problem, you can mark your answer as the answer to this question. This will help others who meet the same problem. Thank you for your patience. – Cindy Pau Dec 16 '19 at 02:35