Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When publishing website on azure, webjobs are deleted

When I publish a site on existing one where I created multiple webjobs, this deletes all the files on server and all the web jobs are deleted.

I assume this is because webjobs are stored in App_Data folder. When the APP_Data directory is deleted, the jobs are deleted.

How can I avoid deleting the app_data folder when doing a publish?

like image 894
Umair Avatar asked Jun 28 '14 08:06

Umair


2 Answers

A third option to Andy's answer would be to deploy you WebJobs with your website, just make sure the WebJobs scripts go to the right place which is under app_data\jobs\{job type: continuous/triggered}\{job name}.

See more about deploying WebJobs: http://blog.amitapple.com/post/74215124623/deploy-azure-webjobs/

like image 136
Amit Apple Avatar answered Dec 09 '22 16:12

Amit Apple


I noticed this as well and can offer the solutions I came up with.

If you are publishing from Visual Studio you can deselect the file publish option "Remove additional files at destination". Of course you are now no longer deleting unused files on the server which probably isn't ideal.

The other option is to simply create a second website just for your webjobs. You can leave the site blank, you don't need to publish anything to it or configure anything beyond the webjobs. One advantage to this approach is you can monitor (and potential scale) the webjobs site separately from your original website.

like image 21
Andy Mehalick Avatar answered Dec 09 '22 15:12

Andy Mehalick