With .NET Core RC2, publishing Azure WebJob is a little bit different from the traditional(?) way, even it’s different from what RC1 does. In this post, we’ll walk through how to publish Azure WebJob using a .NET Core RC2 console application.

Sample code can be found at https://github.com/devkimchi/.NET-Core-for-Azure-WebJob-Sample.

Sample Hello World Console Application

OK. First thing’s first. Let’s create a console app using .NET Core RC2. Take the latest copy from the repository above and build it on your local machine. Then run the console app like:

Then you can see the following:

Now, we’re ready to publish Azure WebJob with this.


In order to publish this console app, we need to do some more work beforehand. Azure WebJob looks for run.cmd to run the console application as a webjob. Therefore, we need to create a file and name it as run.cmd. The content is simply:

Wait. Can we run Azure WebApp with .NET Core RC2? Let’s double check. When you go to your Azure WebApp’s KUDU, you can confirm .NET Core RC2 has already been up and running.

We now don’t have to worry about that. Let’s keep preparing for publish. When we publish this console app, the run.cmd doesn’t automatically get copied to the published directory. We need to include it by modifying project.json like:

With this publish options, the run.cmd file will be included to the published directory. The list of published files in the directory are:

We need to create a .zip file and include all into the zip file. Once we complete, we’re ready to deploy this to Azure.

We assume this web job is a triggered webhook. If it is a scheduled one, we need to create a settings.job file containing CRON schedule and include it for publish.


Using MSDeploy.exe is the easiest way. However, it needs too many parameters. Therefore, we’re going to use WAWSDeploy. More details about WAWSDeploy can be found here. With this, we only need the zip file we prepared and a publish settings file downloaded from Azure Portal. The publish settings file can be downloaded here:

We’re all set! Now, try the following command to deploy the web job:

Target directory will be app_data\jobs\triggered\[WEBJOB_NAME]. If this web job is a continuously running one, replace triggered with continuous.

Now, we’ve deployed the web job to Azure!

Execution on Azure Portal

Once the web job is deployed to Azure, we can visually confirm that’s deployed.

Run this web job and see how the log looks like.

The console app as a web job has successfully run!

Azure Platform
, , ,

Join the conversation! 2 Comments

  1. Is there also a possiblity to to have multiple jobs on the schedule this way or is that only possible when using the Azure webjobs SDK?

    • Good question. Scheduled job can be deployed in this way. Just make sure that the webjob needs to be CRON job settings manually in Azure Portal!

Comments are closed.