Woocommerce Menu

How to deploy .Net Core webjob with Azure DevOps Pipeline

I had been looking into way to deploy Azure WebJob via azure DevOps build and release pipeline. While Microsoft has not given clear example, various blogs have given various examples. Some blogs have shared power shell scripts also.

We can make this very simple by means of out of the box features available with .Net Core build pipeline task and App Service deploy release pipeline task. Let’s see how we can do it in simple 5 steps.

1.Add run.bat file to webjob project file to setting up start up dll name.

You must set Copy Always at property window of the file.

2.Add setting.job file to your project if the webjob is triggered job

Set your CRON expression here and set Copy always for this file too.

3.Publish your web job to artifact staging directory at your build pipeline using .NET core task

Arguments: –configuration $(BuildConfiguration) –output $(build.artifactstagingdirectory)/{your custom path}

4. Copy package using Azure App service deploy task

Microsoft has introduced Azure App service deploy task to deploy your web application. This task can be used to deploy your web job also.

5. Setting up virtual directory at app service Configuration blade to setting up web job deploy path

Note that if your web job is Triggered web job, it must be deployed at triggered folder and if it’s Continuous, it should be deployed at continuous folder.

Hope you enjoyed this simplest mechanism to deploy your web job.

Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *