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

标签 azure asp.net-web-api

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

我不确定这是否可能。我尝试过从 Visual Studio 进行部署,但 API 托管在 xyz.azurewebsites.net 上,并且可以从任何地方访问。

提前致谢。

最佳答案

您可以通过 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

关于azure - 如何将azure api应用程序部署到专用网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41058154/

相关文章:

azure - Microsoft Azure DDOS 防护

Azure AD B2C - 使用图形 API 填充 "Authentication Email"

azure - 在 powershell 脚本中运行时,Invoke-AzureRmVMRunCommand 命令显示错误的输出

asp.net - IIS 8.5 上的 HTTP PUT 失败

asp.net - WCF 与 Web-api 平台中的数据和事务

c# - 将 Web API 用于 Windows 服务以通过轮询接收命令和执行任务?

azure - WindowsAzure.Storage SDK 缺少 .NET Standard 中的 API

azure - Azure redis 缓存补丁计划配置中的维护窗口属性是什么?

c# - 使用 HttpClient 时避免从异步函数返回类型 Task<Object>

asp.net-web-api - mvc webapi 跨域发布