How to deploy a webjob through CI in VSO with vNex

2019-02-20 22:55发布

问题:

I'm trying to deploy a scheduled webjob through CI and vNext tasks in VSO.

I followed the steps in the following tutorial to deploy a webjob along with a web app ("Enable automatic deployment with a web project"): https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-deploy-webjobs/

I succeeded partially: the webjob gets deployed along with the web application. However, it is marked as On Demand instead of Scheduled (or whatever the proper status is). I can run the webjob manually and it runs just fine. I checked the files webjob-publish-settings.json (in the webjob) and webjobs-list.json (in the web app) and they seem to be alright, judging from the tutorial.

Am I missing anything? Thank you.

回答1:

You can use the cron expression to create the webjob scheduler if your app is running in Basic or High mode. Refer to this link for details: Create a scheduled WebJob using a CRON expression

Otherwise, you need to enable continues delivery of Azure Webjobs.

More reference: Deploy your WebJobs projects with your Azure website using continuous delivery