07 - Extending with Triggers (Dedicated)¶
Add Timer, Queue, and Blob triggers to your Dedicated (App Service Plan) 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