如何将azure api应用程序部署到专用网络

时间:2016-12-09 10:22:34

标签: azure asp.net-web-api

我想使用在Azure中托管web api的一些好处,但我希望api是私有的(无法从外部世界访问),因为它只在内部使用。

我不确定这是否可行。我尝试从visual studio进行部署,但是api托管在xyz.azurewebsites.net上,可以从任何地方访问。

提前致谢。

2 个答案:

答案 0 :(得分:1)

您可以通过web.config将对网站的访问限制为特定的IP地址或地址范围。将部分添加到system.webServer

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

此处有更多信息:IP and Domain Restrictions for Windows Azure Web Sites

答案 1 :(得分:1)

除了关于静态IP安全限制访问的levelnis建议外,还可以选择使用App Service Environment。

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-app-service-environment-intro

  

应用服务环境非常适合应用程序工作负载   需要:

     
      
  • 非常高的规模
  •   
  • 隔离和安全网络访问
  •   

ASE始终位于虚拟网络的子网中,因此您可以使用NSG来控制访问。虽然ASE是高级服务,但它可能非常昂贵。