title: How can I manage robots.txt in Azure app service with a staging slot
body: <p>I have an ASP.NET MVC app running in an Azure app service with one staging slot, and a build and release pipeline in <code>VSTS</code>.</p>
  
  <p>I want the production instance to have <code>Allow /</code> in robots.txt and <code>Disallow /</code> in the staging slot at all times. </p>
  
  <p>Currently we are changing robots.txt manually every time we do a swap but this is error prone</p>
  
  <blockquote>
    <p>How can I automate this process?</p>
  </blockquote>
  
  <p>To solve this problem I did consider creating the robots.txt file dynamically based on app settings set in the Azure portal (set to stay with the slot), however this won't work since after the swap happens prod will have the staging <code>Disallow</code> rule.</p>
  
  <p>Can anyone advise the best way to manage this?</p>