0

I have a console application which is called at different times with different parameters:

myapp.exe daily // starts every day
myapp.exe weekly // starts once a week

in Windows I call these using the Task Scheduler

Now I need to deploy this zu Azure. I know I can define a schedule in settings.json like this:

{
    "schedule": "0 0 1 * * *"
} 

Now my two problems are:

  • How to add multiple Schedules
  • How to add a startup-parameter for each of these schedules

I need to deploy my code automatically via Azure DevOps so manually changing parameters like suggested there does not really work for me:

To pass parameters to the WebJob you need to go to the scheduled job (in the management portal) and update the url that is used to invoke the triggered WebJob. https://stackoverflow.com/a/30113977/680026

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
  • If you are using webjob, you can use a timertrigger ? https://stackoverflow.com/questions/36218203/continuous-webjob-with-timer-trigger – Thomas Jun 29 '19 at 08:48

1 Answers1

1

Well, the post you've referenced is actually relevant yet bit outdated. Azure Scheduler service is being phased out in favor of Azure Logic Apps, so what you need to do is:

  1. Create a new logic app with the "Recurrence" trigger, set the desired (let's say daily) interval in it;
  2. Add "HTTP" action using POST method and your WebJob API URL with 'daily' argument;
  3. Create another logic app with a weekly interval and 'weekly' argument in HTTP action's URL.

Here is the screenshot of the Logic App I've sketched for a daily trigger: enter image description here

aidden
  • 543
  • 2
  • 6