public static async Task RunScheduled( [TimerTrigger("0 00 19 * * *")] TimerInfo timerInfo, [OrchestrationClient] DurableOrchestrationClient starter, ILogger log) { if (!string.IsNullOrEmpty(UtilityHelper.CheckConfig())) { throw new Exception($"Error => {UtilityHelper.CheckConfig()}"); } string instanceId = await starter.StartNewAsync("RetrievePowerBIReports", null); log.LogInformation($"Started orchestration with ID = '{instanceId}'."); }
public static async Task <HttpResponseMessage> Run( [HttpTrigger(AuthorizationLevel.Function, methods: "get", Route = "orchestrators/{functionName}")] HttpRequestMessage req, [OrchestrationClient] DurableOrchestrationClientBase starter, string functionName, ILogger log) { // Function input comes from the request content. if (!string.IsNullOrEmpty(UtilityHelper.CheckConfig())) { throw new Exception($"Error => {UtilityHelper.CheckConfig()}"); } dynamic eventData = await req.Content.ReadAsAsync <object>(); string instanceId = await starter.StartNewAsync(functionName, eventData); log.LogInformation($"Started orchestration with ID = '{instanceId}'."); var res = starter.CreateCheckStatusResponse(req, instanceId); res.Headers.RetryAfter = new RetryConditionHeaderValue(TimeSpan.FromSeconds(10)); return(res); }