title: What is the proper way to add rewrite rules in an Azure App Service
body: <p>I want to add re-write rules to my Azure app service, but if I even try create a web.config with a simple rewrite as shown below, the site returns an HTTP 500.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;configuration&gt;
      &lt;system.webServer&gt;
          &lt;rewrite&gt;
              &lt;rules&gt;
                  &lt;rule name="Test" stopProcessing="true"&gt;
                      &lt;match url="test" /&gt;
                      &lt;action type="Rewrite" url="/index.html" /&gt;
                  &lt;/rule&gt;
              &lt;/rules&gt;
          &lt;/rewrite&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What I did is create the web.config from scratch and FTP it into the wwwroot folder for the app service which is where I Ftp'd the rest of my web site files.</p>
  
  <p>I have seen an <a href="https://stackoverflow.com/questions/2362191/is-it-possible-to-edit-web-config-of-cloud-app-deployed-on-windows-azure-without">old conversation</a> about web.config files in Azure, but I'm not even sure if this is in regards to Azure app service - and things change so quickly in Azure that I thought I should ask separately anyways.</p>
  
  <p>I have also seen <a href="https://blogs.msdn.microsoft.com/waws/2014/06/17/transform-your-microsoft-azure-web-site/" rel="nofollow noreferrer">this link</a> about using web.config transforms.  Maybe this is required?</p>
  
  <p><a href="https://gallery.technet.microsoft.com/Azure-Web-App-webconfig-an-803b5bcb" rel="nofollow noreferrer">This other link</a> seems to indicate that updating web.config is possible, but their example results in an HTTP 500 for me as well.</p>
  
  <p>I've looked through configuration options in the Azure portal for my app service and nothing seems to jump out at me.</p>