Webjobs disappear from the Azure Web Apps
The first thing to check if you are using Visual Studios to deploy your web app is to check the Publish Settings for your web app. Expand the File Publish Options and make sure the setting “Remove additional files at destination”. If this setting is enabled, all the application files including webjobs will be deleted prior to the Webdeploy. If this setting is required, a simple workaround is to deploy all the webjobs to a separate web app to avoid this issue. See the explanation below for more detail:
|If you select this option, make sure that you use the preview feature so that you see in advance which files will be deleted before you deploy. The expected behavior is that Web Deploy will delete files on the destination server that you have deleted in your project. However, the entire folder structure under the source and destination folders is compared, and in some scenarios Web Deploy might delete files you don’t want to delete.
For example, if you have a web application in a subfolder on the server when you deploy a project to the root folder, the subfolder will be deleted. You might have one project for the main site at contoso.com and another project for a blog at contoso.com/blog. The blog application is in a subfolder. If you select Remove additional files at destination when you deploy the main site, the blog application will be deleted.
For another example, your App_Data folder might get deleted unexpectedly. Certain databases such as SQL Server Compact store database files in the App_Data folder. After the initial deployment you don’t want to keep copying the database files in subsequent deployments so you select Exclude App_Data on the Package/Publish Web tab. After you do that, if you have Remove additional files at destination selected, your database files and the App_Data folder itself will be deleted the next time you publish.