Laser timer function settings through application settings

I am working on setting a timer for Azure functions, I need to get the cron expression from the appsettings settings. Please let me know how I can get the value from the application settings in Azure features. I want to start my azure function from 9:00 to 12:00 PM every 30 minutes \

{
 "disabled": false,
 "bindings": [
   {
     "name": "timerInfo",
     "type": "timerTrigger",
     "direction": "in",
     "schedule": "0 * * * * *"
   }
 ]
}
+15
source share
3 answers

Set the schedule as "schedule": "%EmailScheduleTriggerTime%", and then in appsetting.json or local.settings.json you can set the value of EmailScheduleTriggerTime as"0 30 9-12 * * *"

{
  "IsEncrypted": false,
  "Values": {
    "EmailScheduleTriggerTime": "0 30 9-12 * * *", //Run every  30 minutes from 9:00 to 12:00

  },
  "ConnectionStrings": {
    "DefaultConnection": ""
  }
}

[FunctionName("TimerfunctionApp")] 
public static void Run([TimerTrigger("%EmailScheduleTriggerTime%")] TimerInfo TInfo, TraceWriter log)
+18
source

VS2017 Functions .NET- ( Azure), AppSettings %:

[FunctionName("MyTimerFunction")] 
public static void Run([TimerTrigger("%TimerInterval%")] TimerInfo myTimer, TraceWriter log, ..

CRON, . local.settings.json

{
  "Values" : { 
      "TimerInterval" : "0 30 9-12 * * *"
    }
}
+23

"schedule": "0 */30 9-12 * * *", Azure Functions . azure .

- CRON, :

{} {.} {} {} {} { }

:

, CRON, (UTC). CRON , WEBSITE_TIME_ZONE

0
source

Source: https://habr.com/ru/post/1683132/


All Articles