Reputation: 53
I would like to deploy a WebJob to schedule a task every day. The code for the task is available in my Webapp code because it is an action the user can perform on the UI. My understanding is that the webjob is deployed via a self-containde zip file. As a result I would have to deploy the webjob separately from the webapp and package some code which is already part of the webapp in it.
Is there a smart way to avoid duplicating the code and have a webjob call an API on the webapp ?
Upvotes: 1
Views: 312
Reputation: 1570
If it is an action, than you don't need to duplicate the code, you can just make a REST call from your WebJob to that action what you already created.
If you don't want you won't even need to create a WebJob, as an alternative you can use Azure Automation: Azure Automation: Calling a URL
Or you can use Azure Scheduler: https://learn.microsoft.com/en-us/azure/scheduler/scheduler-get-started-portal
Upvotes: 0