Scheduling a Web Job (console application) using Azure Scheduler


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

https://$CRMAzureWebJob:hyNboz8Skys3yrQ2MkpYnseXr7Kborq82JhEX09B32ExtjiYkxxgwejqsH@crmazurewebjob.scm.azurewebsites.net/api/triggeredwebjobs/TriggeredWebJob/run

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..

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

9 thoughts on “Scheduling a Web Job (console application) using Azure Scheduler”

  1. 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?

    Like

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Dynamics 365 Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog

Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Knowhere365

Specific topics by Django Lohn on the whole Microsoft365 Stack

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue MVP

A Microsoft Business Applications MVP

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.

CRM Keeper

Dynamics 365 Customer Engagement, CRM, Microsoft CRM, Dynamics CRM