Schedule an Azure webjob for an existing Console Application project

By: Shaili Modi

This can be used when we want a Console application to run on a regular interval using Azure Scheduler.

Prerequisites

WebJobs deployment features are available in Visual Studio 2013 when you install Azure SDK version 2.4 or later versions: Azure SDK for Visual Studio 2013.

The WebJobs deployment features are also included in Visual Studio 2013 Update 3 and later updates.

Use this to configure an existing Console Application project to deploy as a WebJob by itself, with no link to a web project. This is very useful when you want to run a WebJob in a web app by itself. You might want to do this in order to be able to scale your WebJob resources independently of your web application resources.

Right-click the Console Application project in Solution Explorer, and then click Publish as Azure WebJob.

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-1

A dialog box appears, with the project selected in the Project name box.

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-2

Once you click OK, the following dialog appears:

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-3

You can select it to create in an existing web app or create a new web app or import a publish profile.

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-4

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-5

On clicking on Publish it creates the web job which can be viewed and managed from https://manage.windowsazure.com/
The Outputs and Logs are saved in FTP for the web app and can be viewed in the following path under FTP: /data/jobs/triggered/(Job_Name)

sharepoint-blog-schedule-an-azure-webjob-for-Console-Application-project-6

Comments are closed.