Triggers & Bindings Overview
Azure Functions can be invoked by a variety of triggers and can interact with external resources via bindings. Triggers start the execution of a function, while bindings provide declarative data input and output without writing integration code.
HTTP Trigger
Invokes a function via an HTTP request.
{
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"authLevel": "function",
"methods": ["get","post"]
},
{
"type": "http",
"direction": "out"
}
]
}
Timer Trigger
Runs on a schedule defined with a CRON expression.
{
"bindings": [
{
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */5 * * * *"
}
]
}
Blob Trigger
Executes when a new or updated blob is detected.
{
"bindings": [
{
"type": "blobTrigger",
"direction": "in",
"path": "samples-workitems/{name}",
"connection": "AzureWebJobsStorage"
},
{
"type": "blob",
"direction": "out",
"name": "outputBlob",
"path": "processed/{name}",
"connection": "AzureWebJobsStorage"
}
]
}
Queue Trigger
Invoked when a new message appears in an Azure Queue.
{
"bindings": [
{
"type": "queueTrigger",
"direction": "in",
"name": "msg",
"queueName": "myqueue-items",
"connection": "AzureWebJobsStorage"
}
]
}
Event Grid Trigger
React to events from Azure Event Grid.
{
"bindings": [
{
"type": "eventGridTrigger",
"direction": "in",
"name": "event"
}
]
}
Cosmos DB Trigger
Runs when changes occur in a Cosmos DB container.
{
"bindings": [
{
"type": "cosmosDBTrigger",
"direction": "in",
"name": "documents",
"databaseName": "mydb",
"collectionName": "mycoll",
"connectionStringSetting": "CosmosDBConnection",
"leaseCollectionName": "leases"
}
]
}
Input Bindings
| Binding Type | Direction | Typical Uses |
|---|---|---|
| blob | in | Read from a blob storage file |
| queue | in | Read a message from a queue |
| cosmosDB | in | Retrieve a document by id |
| http | in | Access request metadata |
Output Bindings
| Binding Type | Direction | Typical Uses |
|---|---|---|
| blob | out | Write data to a blob |
| queue | out | Place a message onto a queue |
| cosmosDB | out | Insert or update a document |
| signalR | out | Send real‑time messages |
Sample Functions
Explore the repo for complete function samples: