NeutronCode
NeutronCode

Reputation: 365

Protect a Web App from Access in Azure

I have a web app running a old ASMX service that I want to limit access to for only other apps and services within my azure environment.

Is there any easy and cheap way to do this?

App Service Environments seems like it does this, but they seem rather expensive for this small purpose. I would be cheaper with a VM that I can configure the firewall on.

Upvotes: 1

Views: 91

Answers (1)

homelessDevOps
homelessDevOps

Reputation: 20726

If you know the IP-Ranges you can use web.config file in root of your app:

<security>
    <ipSecurity allowUnlisted="false">    <!-- this line blocks everybody, except those listed below -->                
        <clear/> <!-- removes all upstream restrictions -->
        <add ipAddress="127.0.0.1" allowed="true"/>    <!-- allow requests from the local machine -->
        <add ipAddress="81.116.19.53" allowed="true"/>   <!-- allow the specific IP of 81.116.19.53  -->                
        </ipSecurity>
</security>

Upvotes: 1

Related Questions