Refer this as well https://nishantrana.me/2018/02/22/update-schedule-of-existing-azure-webjobs-triggered/
Let us a create a simple console application that writes Hello World to the console which we would be scheduling using Azure Scheduler.
Have kept the example simple so that we can understand the configuration part.
Right click on the project and Publish it as Azure WebJob
We will set the mode as “Run On Demand”
For the pubish target we have selected Microsoft Azure App Service web app under which this Web Job will run.
Select the App Service or configure a new one, we have selected the existing App Service below
Click on Validate to check the connection, if everything is fine Click Next and Publish the web role.
Our TriggeredWebJob inside CRMAzureWebJob App Service –
We can run it on Demand by clicking on Run.
Clicking on Logs
Will provide the details of the Web Jobs
Now to schedule the Web Job we need to create a Scheduler Job, for this go to Scheduler Job Collections and click on Add
Create a new Job inside Job Collection and provide the required details like Name, Pricing Tier, Resource Group etc.
Next step is to configure the Action settings, wherein we will trigger our Web Job.
For this we need to define Action as Https, Method as Post and the URL
Format of the URL should be like –
https://{userName}:{password}@{WebAppName}.scm.azurewebsites.net/api/triggeredwebjobs/{WebJobName}/run
To get the above details open the Web Job properties
Replace the appropriate values
Last step is to schedule it
Here we have selected it to run immediately, every 2 minutes for total of 10 occurrences.
Finally click on Create which will create the job
We can monitor our Job
Going back to our Web Job Logs we can see it ran 3 times with interval of 2 minutes till that point
The other option to schedule a Web Job without using Azure Scheduler is to use the Cron Job but this requires minimum Basic tier subscription. Basically, the Web App must be configured for “Always On”, which requires a Basic or Standard plan.
http://patrickdesjardins.com/blog/azure-webjobs-using-cronjobs
http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.WNCQKDt9600
And in Free tier
https://www.schaeflein.net/azure-webjobs-free-tier/
Hope it helps..
Excellent article, and step-by-step guide. Thanks for sharing. There is only question/ concern which is regarding passing credentials (especially, password) in URL while configuring Action Settings. Is there any other option where we can ignore credentials as part of URL and place it somewhere else?
LikeLike
Excellent
LikeLike
Thanks for sharing
LikeLiked by 1 person
Great Post, thanks for sharing.
LikeLiked by 1 person
Can we update the schedule through C# application
LikeLike
Reblogged this on MS CRM.
LikeLike