-
Notifications
You must be signed in to change notification settings - Fork 442
function.json
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.
HttpTrigger Example:
{
"bindings": {
"input": [
{
"type": "httpTrigger",
"route" "orders",
"authLevel" "anonymous"
}
]
}
}
QueueTrigger Example:
{
"bindings": {
"input": [
{
"type": "queueTrigger",
"name": "workItem",
"queueName": "samples-workitems"
}
]
}
}
BlobTrigger Example:
{
"bindings": {
"input": [
{
"type": "blobTrigger",
"path": "samples-workitems"
}
]
}
}
TimerTrigger Example:
{
"bindings": {
"input": [
{
"type": "timerTrigger",
"schedule": "*/15 * * * * *",
"runOnStartup": true
}
]
}
}
ServiceBusTrigger Example (Queue):
{
"bindings": {
"input": [
{
"type": "serviceBusTrigger",
"queueName": "testqueue"
}
]
}
}
ServiceBusTrigger Example (Topic):
{
"bindings": {
"input": [
{
"type": "serviceBusTrigger",
"topicName": "testtopic",
"subscriptionName": "testsubscription"
}
]
}
}
ManualTrigger Example (Can only be run by invoking via WebHost admin API):
{
"bindings": {
"input": [
{
"type": "manualTrigger"
}
]
}
}
Function bindings can get pretty sophisticated. In addition to trigger input bindings, they can also declare non-trigger input bindings which can be used to read objects from storage and make them available to script. They can also declare output bindings that can write result objects to storage.
Here's a canonical example for a function that receives a queue message, reads an input blob, processes that blob and writes the result to another blob:
{
"bindings": {
"input": [
{
"type": "queueTrigger",
"queueName": "image-resize"
},
{
"type": "blob",
"name": "original",
"path": "images-input/{name}"
}
],
"output": [
{
"type": "blob",
"name": "resized",
"path": "images-output/{name}"
}
]
}
}
For all bindings, the type
value must be one of the supported binding types (e.g. "queue", "queueTrigger", "blob", "blobTrigger", "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.
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]