title: ApplicationHost.xdt in Azure Web Apps
body: <p>How to change applicationHost.config in an Azure web app?
  I try:</p>
  
  <pre><code>using (ServerManager serverManager = new ServerManager())
  {
      Microsoft.Web.Administration.Configuration config = serverManager.GetApplicationHostConfiguration();
      Microsoft.Web.Administration.ConfigurationSection webLimitsSection = config.GetSection("system.applicationHost/webLimits");
  
      webLimitsSection["connectionTimeout"] = TimeSpan.Parse("00:00:10");
      webLimitsSection["dynamicIdleThreshold"] = 150;
      webLimitsSection["headerWaitTimeout"] = TimeSpan.Parse("00:00:10");
      webLimitsSection["minBytesPerSecond"] = 500;
  
      serverManager.CommitChanges();
  }
  </code></pre>
  
  <p>But catch exception: </p>
  
  <blockquote>
    <p>Filename: \?\D:\Windows\system32\inetsrv\config\applicationHost.config
    Error: Cannot write configuration file due to insufficient permissions</p>
  </blockquote>