Skip to content

function.json

Mathew Charles edited this page Nov 21, 2015 · 29 revisions

In a script function directory, there should be a companion function.json file that contains the configuration metadata for the function. Below are examples for each of the trigger types.

QueueTrigger Example:

{
  "trigger": {
    "type": "queue",
    "queueName": "testqueue"
}

BlobTrigger Example:

{
  "trigger": {
    "type": "blob",
    "blobPath": "testcontainer"
  }
}

TimerTrigger Example:

{
  "trigger": {
    "type": "timer",
    "schedule": "*/10 * * * * *",
    "runOnStartup": true
  }
}

WebHookTrigger Example:

{
  "trigger": {
    "type": "webHook"
  }
}

ServiceBusTrigger Example (Queue):

{
  "trigger": {
    "type": "serviceBus",
    "queueName": "testqueue"
  }
}

ServiceBusTrigger Example (Topic):

{
  "trigger": {
    "type": "serviceBus",
    "topicName": "testtopic",
    "subscriptionName": "testsubscription"
  }
}

Functions can also declare output bindings. Here's an example function declaring a single blob output binding:

{
  "trigger": {
    "type": "queue",
    "queueName": "testqueue"
  },
  "outputs": [{
      "type": "blob",
      "name": "output",
      "path": "testcontainer/{id}"
    }]
}

The type value must be one of the supported output binding types (e.g. "queue", "blob", "table", etc.). The name value defines the identifier that the script will use to write to the binding. The remaining properties are binding type specific. For a blob binding there is a path property, for a queue binding a queueName property, etc.

Learn

Azure Functions Basics

Advanced Concepts

Dotnet Functions

Java Functions

Node.js Functions

Python Functions

Host API's

Bindings

V2 Runtime

Contribute

Functions host

Language workers

Get Help

Other

Clone this wiki locally