Search code examples
node.jstypescriptazure-functionsazure-cosmosdbazure-functions-core-tools

Cosmos DB Trigger binding not registered?


I have a simple azure function cosmos trigger set up, like so:

{
  "bindings": [
    {
      "type": "cosmosDBTrigger",
      "name": "documents",
      "direction": "in",
      "leaseCollectionName": "leases",
      "connectionStringSetting": "DbConnectionString",
      "databaseName": "mydb",
      "collectionName": "mycollection",
      "createLeaseCollectionIfNotExists": "true"
    }
  ],
  "scriptFile": "../dist/TestCosmosTrigger/index.js"
}

When I run the function I get an error:

The 'TestNotifier' function is in error: The binding type(s) 'cosmosDBTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.

Not sure what I'm doing wrong, perhaps it's a bug in the nodejs azure functions?

edit: after updating the azure function tools on my computer now a whole bunch of other bindings have started failing with the same error such as signalr:

{ "type": "signalRConnectionInfo", "name": "connectionInfo", "hubName": "chat", "userId": "{headers.authorization}", "direction": "in" }

signalRConnectionInfo binding extension is not installed.


Solution

  • After updating azure function core tools with:

    npm i -g azure-functions-core-tools@core --unsafe-perm true

    and then running:

    func extensions install -p Microsoft.Azure.WebJobs.Extensions.SignalRService -v 1.0.0

    It looks like the above issue was resolved, a new problem opened up but that's a seperate issue.