e
This commit is contained in:
parent
37c4b8caaa
commit
17548fec12
6 changed files with 44 additions and 0 deletions
1
src/data/azure_function_timer/.gitignore
vendored
1
src/data/azure_function_timer/.gitignore
vendored
|
@ -3,3 +3,4 @@ bin
|
|||
include
|
||||
lib
|
||||
lib64
|
||||
local.settings.json
|
||||
|
|
5
src/data/azure_function_timer/.vscode/extensions.json
vendored
Normal file
5
src/data/azure_function_timer/.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"ms-azuretools.vscode-azurefunctions"
|
||||
]
|
||||
}
|
2
src/data/azure_function_timer/deploy.sh
Executable file
2
src/data/azure_function_timer/deploy.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
func azure functionapp publish cron-map-scrape
|
16
src/data/azure_function_timer/function_app.py
Normal file
16
src/data/azure_function_timer/function_app.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import azure.functions as func
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
|
||||
app = func.FunctionApp()
|
||||
|
||||
|
||||
@app.timer_trigger(
|
||||
schedule="* * * * * *", arg_name="myTimer", run_on_startup=False, use_monitor=False
|
||||
)
|
||||
def Timer(myTimer: func.TimerRequest) -> None:
|
||||
if myTimer.past_due:
|
||||
logging.info("The timer is past due!")
|
||||
|
||||
logging.info("Python timer trigger function executed.")
|
15
src/data/azure_function_timer/host.json
Normal file
15
src/data/azure_function_timer/host.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"version": "2.0",
|
||||
"logging": {
|
||||
"applicationInsights": {
|
||||
"samplingSettings": {
|
||||
"isEnabled": true,
|
||||
"excludedTypes": "Request"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extensionBundle": {
|
||||
"id": "Microsoft.Azure.Functions.ExtensionBundle",
|
||||
"version": "[4.*, 5.0.0)"
|
||||
}
|
||||
}
|
5
src/data/azure_function_timer/requirements.txt
Normal file
5
src/data/azure_function_timer/requirements.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Do not include azure-functions-worker in this file
|
||||
# The Python Worker is managed by the Azure Functions platform
|
||||
# Manually managing azure-functions-worker may cause unexpected issues
|
||||
|
||||
azure-functions
|
Loading…
Reference in a new issue