Docs › Azure Functions timer trigger with RunVouch
Azure Functions timer trigger with RunVouch
A timer-triggered function that runs, catches its own exception and returns is a success in Application Insights. A function app that is stopped does not run at all, and no default alert says so.
How it runs on Azure Functions timer trigger
Inside the function, with the Python client or the two HTTP calls. NCRONTAB schedule stays as it is.
Store the key
Store the key in Key Vault and reference it from an app setting (@Microsoft.KeyVault(SecretUri=...)), or as a plain app setting for a first test.
Report the run (two HTTP calls)
import azure.functions as func, runvouch
app = func.FunctionApp()
@app.timer_trigger(schedule="0 0 2 * * *", arg_name="timer")
def nightly_report(timer: func.TimerRequest):
with runvouch.vouch("nightly-report", evidence=lambda: {"blob_written": ok}) as run:
ok = build_report()The start call returns run_id; the end call takes status (ok or fail), optional cost and tokens, and evidence as a JSON object of booleans. Full reference on the API page.
Register the cadence and caps
rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2
Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.
What goes silent on Azure Functions timer trigger
- On the Consumption plan the timer trigger runs on a scale controller; when the app is stopped or the storage account is unreachable, nothing fires and nothing alerts. MISSED does.
timer.past_duetells your code a run was late; it does not tell you.- Application Insights availability tests cover HTTP endpoints, not whether a nightly job produced its output.
What RunVouch detects
| Alert | What it means here |
|---|---|
| MISSED | cadence plus grace passed and no run started |
| FAILED | non-zero exit or a reported failure, with the stderr excerpt |
| NO_EVIDENCE | the run said ok but the file, URL or assertion you required is missing |
| STALLED | a run started and never ended within max runtime |
| RETRY_STORM | the same tool called with identical input many times in one run |
| BUDGET_RUN / BUDGET_DAY | cost cap crossed; the agent is paused until you resume it |
| DRIFT | duration or output size far off its 7-run baseline |
Need a key? Get a free key · Stuck? contact