1
votes

I have 2 .NET Core 3.1 WebJob in a single solution. I am able to build each of the Webjobs and created the .zip files for each job in which the folder structure is in the below format :

TestJob_1.zip --- App_Data\jobs\continuous\TestJob_1

TestJob_2.zip --- App_Data\jobs\continuous\TestJob_2

Now, in order to deploy both of my webjob, I have added 2 "Azure App Service Task", pointing to same App Service, and given the folder location as below for each of my webjobs repectively.

enter image description here

Now, if I run my Release pipeline, all my tasks are successfully completed. And when I checked in my App Service, I see only the TestJob_2 is published.

And after these, I disabled the task related to TestJob_2 webjob and run the pipeline only with the task for TestJob_1, and now when I checked, TestJob_2 webjob is replaced by TestJob_1 webjob & I can able to see TestJob_1 but not TestJob_2.

Please help me here.

1
I think PatrickLu-MSFT's answer in another post will help you. stackoverflow.com/questions/57049633/…Jason Pan

1 Answers

0
votes
  1. You need to associate webjobs with web app, by right clicking your Web App project in Visual Studio and select Add > Existing Project as Azure WebJob and follow the wizard.
  2. The webjobS are included in the web app package, then you just need to deploy web app to azure app service.
  3. It will generate webjob’s package too during publishing (that why there are two zip files), but you just need to specify web app package in Azure App Service deploy task. (Check Publish using Web Deploy option). Make sure the "Exclude files from the App_data folder" is unchecked:

enter image description here

For details , you can check this ticket.