locked
IP based restriction for Azureweb app RRS feed

  • Question

  • HI,

    I want to enable IP based restriction on Azure web app.

    Is there any sample to do this.

    I followed the below link:

    https://azure.microsoft.com/en-us/blog/ip-and-domain-restrictions-for-windows-azure-web-sites/ 

    but still I am not able to do so.

    What I want is that only I should be able to access my web app from my machine and also on localhost.

    How can I achieve that ? 


    Sushant Kadam

    Monday, October 5, 2015 7:26 PM

Answers

  • HI Chris,

    The above snippet is working for me.

    There was a deployment issue that was causing the problem.

    Regards,

    Sushant Kadam


    Sushant Kadam

    Tuesday, October 6, 2015 10:49 AM

All replies

  • Hi Sushant,

    That blog covers the only way to restrict network access to your web apps outside of using an App Service Environment.  In an App Service Environment you can use Network Security Groups to restrict access to your system.  So between these two features you can lock things down to your IP but you neither will enable you to use localhost.

    Alternatively you can also use Azure Active Directory and lock down access to your web app to your account using the Easy Auth feature.  

    Chris Compy

    Monday, October 5, 2015 7:42 PM
  • HI Chris,

    I used the following snippet for enabling IP based restrictions.

    <system.webServer>
        <security>
          <ipSecurity allowUnlisted="false" denyAction="NotFound">
            <add allowed="true" ipAddress="127.0.0.1" subnetMask=""/>
          </ipSecurity>
        </security>
      </system.webServer>

    This enables my code to work for localhost.

    But what I would like to do is for e.g.

    My IP address is A.B.C.D and my colleague's IP address is W.X.Y.Z then when I publish my ASP.Net web application to Azure web app, I should be able to access it from my machine but not my colleague


    Sushant Kadam

    Tuesday, October 6, 2015 7:42 AM
  • HI Chris,

    The above snippet is working for me.

    There was a deployment issue that was causing the problem.

    Regards,

    Sushant Kadam


    Sushant Kadam

    Tuesday, October 6, 2015 10:49 AM