Deploying Web Jobs

Last updated

Azure Web Jobs can either be packaged and deployed along with the Web App that they live under, or packaged and deployed independently.


Web jobs are deployed to either app_data/jobs/triggered/{job_name} or app_data/jobs/continuous/{job_name}, depending on whether the job is triggered or continuous.

Packaged with the Web App

If you are packaging and deploying your Web App and Web Job together, the Web Job must be packaged in it's location under the App_Data directory.

                    |   WebJob1.exe
                    |   WebJob1.exe.config
                    |   WebJob2.exe
                    |   WebJob2.exe.config

Below is a sample of a nuspec file which could be used to produce the layout above.  For example using OctoPack.

<?xml version="1.0"?><package >
    <description>MyWebApp with WebJobs</description>
    <copyright>Copyright 2015 MyCompany</copyright>
    <file src="..\WebJob1\bin\**\*.*" target="app_data\jobs\continuous\WebJob1" />
    <file src="..\WebJob2\bin\**\*.*" target="app_data\jobs\triggered\WebJob2" />

Packaged Independently

If you are packaging and deploying your Web Job independently to the containing Web App (and possibly other Web Jobs and sub-applications), then it is important you set the Physical Path field to the appropriate location.  For example: