title: How to prevent Azure webjobs from being swapped in Azure website production <--> staging slots
body: <p>I have an Azure website with a production and staging slot with multiple instances.</p>
  
  <p>I  run several Azure webjobs on the site, some of which are triggered others that are continuous.</p>
  
  <p>I understand triggered webjobs will only run once on one instance.  </p>
  
  <p>My current setup is:</p>
  
  <ul>
  <li><p>Production site has no deployment other than swapping from staging</p></li>
  <li><p>Staging website is setup to continuous deployment from bitbucket</p></li>
  <li><p>Webjobs are deployed from within VS to production slot using "publish to Azure" (since AFAIK there is no support for continuous deployment of webjobs that are schedule based)</p></li>
  <li><p>The VS solution for the website is different from the VS solution containing webjobs</p></li>
  </ul>
  
  <p>I noticed when I swap production and staging, webjobs are also swapped!
  I realized this when I had deployed a new webjob to production and subsequently did a website deployment followed by a swap, the newly deployed webjob was no longer in the production slot!</p>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>is it possible to prevent webjobs from swapping between production and staging (webjobs are really entirely different pieces of code than the website)</p></li>
  <li><p>What exactly is swapped for webjobs? Binaries? Schedule? Both ?</p></li>
  <li><p>how do i prevent all webjobs from running on the staging slot? My webjobs do not need to be highly available and i can test them offline easily.</p></li>
  <li><p>If i VS deploy webjobs to the staging slot and do a swap, then the current staging slot will be missing the deployed webjob and I'll lose it when i do my next website update, so where should i be deploying my webjobs?</p></li>
  </ol>
  
  <p>There is a <a href="https://stackoverflow.com/questions/24438789/azure-webjobs-and-deployment-slots">related thread</a> but it assumes the webjob is deployed simultaneously with a website which is not what I have currently. </p>
  
  <p>I really like websites and webjobs, but it seems the story related to continuous independent deployment of webjobs and websites is broken. </p>
  
  <p>Would really appreciate advice!</p>
  
  <p>Thanks</p>