Skip to content

Commit

Permalink
switch timer to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell Laferla committed Aug 24, 2023
1 parent dd13556 commit 72e10c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
10 changes: 9 additions & 1 deletion monitoring_weekly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
import importlib.util

# Azure function timer. To alter timer cadence see function.json file
app = func.FunctionApp()

@app.function_name(name="mytimer")
@app.schedule(schedule="0 5 * * MON",
arg_name="mytimer",
run_on_startup=False,
use_monitor=True)

def main(mytimer: func.TimerRequest) -> None:
utc_timestamp = datetime.datetime.utcnow().replace(
tzinfo=datetime.timezone.utc).isoformat()

if mytimer.past_due:
logging.info('The timer is past due!')

logging.info('Python timer trigger function ran at %s', utc_timestamp)


Expand Down
14 changes: 0 additions & 14 deletions monitoring_weekly/function.json

This file was deleted.

0 comments on commit 72e10c6

Please sign in to comment.