title: How to restrict access to section of website running on Azure
body: <p>I have an Episerver website running on Azure and, for security reasons, i would like to block access to any requests to the cms admin section using a white list of ip addresses.</p>
  
  <p>I have done this in the past with websites running on windows server but i have never done this on an Azure hosted site. I have tried the approach i took on previous sites, adding a security section to the web.config for the location i am trying to restrict eg:</p>
  
  <pre><code>&lt;location path="cms/admin"&gt;
   &lt;system.webServer&gt;
    &lt;/ipSecurity&gt;
     &lt;add allowed="true" ipAddress="{my ip address}" subnetMask="255.255.255.255" /&gt;
  ...
    &lt;/security&gt;
   &lt;/system.webServer&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p>this works locally but it is not working when i deploy the web.config to Azure. it is preventing any users, including those in the whitelist from accessing the location.</p>
  
  <p>I have also looked into making the changes in portal.azure using aplication->networking->Access-restrictions but this looks like it is intended to control access to the whole app, which is not what i want.</p>
  
  <p>Does anybody know if i am doing this incorrectly, specifically for an Azure website? Is there a setting in access-restrictions that i have missed?</p>
  
  <p>thanks</p>
  
  <p>Sam</p>