Protect a Web App from Access in Azure

时间:2016-04-15 14:57:32

标签: azure asmx

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.

1 个答案:

答案 0 :(得分:1)

如果您知道IP-Ranges,则可以在应用程序的根目录中使用web.config文件:

<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>