Create Azure Timertrigger Durable Function In Python
As I claimed in the title, is possible to have an azure durable app that triggers using TimerTrigger and not only httpTrigger? I see here https://docs.microsoft.com/en-us/azure/azu
Solution 1:
Just focus on the start function is ok:
__init__py
import logging
import azure.functions as func
import azure.durable_functions as df
async def main(mytimer: func.TimerRequest, starter: str) ->None:
client = df.DurableOrchestrationClient(starter)
instance_id = await client.start_new("YourOrchestratorName", None, None)
logging.info(f"Started orchestration with ID = '{instance_id}'.")
function.json
{"scriptFile":"__init__.py","bindings":[{"name":"mytimer","type":"timerTrigger","direction":"in","schedule":"* * * * * *"},{"name":"starter","type":"orchestrationClient","direction":"in"}]}
Post a Comment for "Create Azure Timertrigger Durable Function In Python"