title: Azure WebApp Deployment Slot: Pre-Swap Job
body: <p>Hy</p>
  
  <p>We have two app services:</p>
  
  <ul>
  <li><p>RESTService (Azure App Service Web App -> ASP.NET)</p></li>
  <li><p>WebApplication (Azure App Service Web App -> Angular.JS SPA)</p></li>
  </ul>
  
  <p>The RESTService has a web.config and the WebApplication a appconfig.json as their configuration-file.</p>
  
  <p>On each app service we have a staging-slot, where we would like to do some tests (auto and manual). For that reason, we need to have sticky-slot settings for the web.config and the appconfig.json file. With the sticky-slot settings from the portal, I think this is not possible (these settings only apply to appsettings-configurations in a web.config I think).</p>
  
  <p>What is the best way to do that?</p>
  
  <p>I think of something like that:
  - In my release-configuration I deploy the web-apps to the staging slots and then do the modifying (adjust the settings for the staging-environment) on the web.config and the appjson.config in a task (power-shell or something similar)...then I can do the auto-tests, if they succeed I undo my changes in the config-files and swap to production. But what is, if I want to do some manual tests and do the swapping in the portal? Than I have to do the undo of the changes by myself...</p>
  
  <p>Is there maybe something like a pre-swap job, which could trigger before swapping?</p>
  
  <p>Thanks for your help,</p>
  
  <p>Peter</p>