Edit on github

#Other Bindings

The Azure Functions plugin also supports additional input and output bindings. These work by setting the direction explicitly. The properties go under the x-azure-settings property and match the same properties expected in the function.json, with the exception of "type" which is the first property's key.

You can learn about all the bindings Azure has to offer here on the official documentation.


This is an example of outputing data to Document DB.

# serverless.yml

    handler: handler.hello
      - queue: hello
            name: item #<string>, default - "myQueueItem", specifies which name it's available on `context.bindings` 
            connection: AzureWebJobsStorage #<string>, default - "AzureWebJobsStorage", environment variable which contains Storage Account Connection String
      - documentDB: 
            name: record # Name of input parameter in function signature>",
            databaseName: myDocs # "<Name of the DocumentDB database>",
            collectionName: todo # "<Name of the DocumentDB collection>",
            createIfNotExists: true
            connection: docDBAppSetting # "<Name of app setting with connection string - see below>",
            direction: out 
// handler.js

'use strict';

module.exports.hello = function(context, item) {
  context.log("Received item: ${item}");
  context.bindings.record = {
      hello: "world"