07 - Extending with Triggers (Consumption)¶
Add Timer, Queue, and Blob triggers to your Consumption (Y1) PowerShell app. PowerShell uses the classic function.json binding model.
Timer Trigger¶
TimerExample/function.json:
{
"bindings": [
{
"name": "Timer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */5 * * * *"
}
]
}
TimerExample/run.ps1:
Queue Trigger¶
QueueExample/function.json:
{
"bindings": [
{
"name": "QueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "work-items",
"connection": "AzureWebJobsStorage"
}
]
}
Blob Trigger¶
BlobExample/function.json:
{
"bindings": [
{
"name": "InputBlob",
"type": "blobTrigger",
"direction": "in",
"path": "uploads/{name}",
"connection": "AzureWebJobsStorage"
}
]
}
param($InputBlob, $TriggerMetadata)
Write-Information "Blob $($TriggerMetadata.name) is $($InputBlob.Length) bytes"
Verification¶
Deploy, then drop a message on the work-items queue or upload a blob to uploads/. Confirm the invocation appears in az functionapp log tail.
Next Steps¶
Explore the Recipes Index for reusable binding patterns.
Next: Recipes Index — reusable PowerShell trigger and binding patterns.
See Also¶
- Tutorial Overview & Plan Chooser
- PowerShell Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index
Sources¶
- PowerShell developer reference (Microsoft Learn)
- Azure Functions Consumption plan (Microsoft Learn)
- Run Functions locally with Core Tools (Microsoft Learn)
Legacy hosting path
Consumption plan (Y1) content is provided for existing workloads. For most new serverless applications, prefer Flex Consumption.