0

I'm using visual studio 2019 and I created the function app I need to change the value in the local.settings.json file when I run the function app that I want to change the schedule data Cron expression string dynamically

JSON file

 {
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "schedule": "*/10 * * * * *"
  }
}

function app:

[FunctionName("Function3")]
public static async System.Threading.Tasks.Task RunAsync([TimerTrigger("%schedule%")]TimerInfo myTimer, ILogger log)
{            

}
Muthu mani
  • 45
  • 9

1 Answers1

0

There is no solution to set the schedule of Azure Function dynamically by code.

But you could do it using Durable Function, or change the value using kudu API.

Please check the answer of this question: How to create dynamically schedule Azure function using c# in visual studio?

Doris Lv
  • 3,083
  • 1
  • 5
  • 14