问题描述
我想使用虚拟网络来限制仅从我的App Service对Azure数据库的访问,以便可以在防火墙设置中打开允许对App Services的访问"
I want to use virtual network in order to limit access to Azure Database only from my App Service, so that I can turn of "Allow access to App Services" in firewall settings
- 我去了App Service->网络-> VNET集成->设置->创建新的虚拟网络
- 我已经使用默认设置创建了新的VNET.
- 创建VNET时,我去了App Service->网络-> VNET集成,并确保VNET已连接
- 我转到了SQL防火墙settigs->虚拟网络->添加现有的Virtual Newtork并选择了我的VNET.我保留了默认子网和地址空间:"default/10.0.0.0/24",并且未选中IgnoreMissingServiceEndpoint标志.
我现在可以在VNET中看到Microsoft.Sql服务终结点:
I can now see Microsoft.Sql service endpoint in my VNET:
但是,我仍然得到
我想念什么?
推荐答案
不幸的是,您暂时无法实现此方案.
Unfortunately, you cannot achieve this scenario for now.
原因:
-
将VNET Integration与Web App一起使用时,Web App可以像
Web App <---> VNET
一样与VNET通信.
When you use VNET Integration with your Web App, your web App can communicate with the VNET like
Web App <---> VNET
.
当您使用SQL防火墙允许来自特定VNet的流量时,来自VNET地址空间的流量可以像VNet <---> SQL server
一样与您的SQL通信.
When you use SQL firewall to allow traffic from a specific VNet, so the traffic from the VNET address space can communicate with your SQL like VNet <---> SQL server
.
设置所有配置后,您的方案应为Web App <---> VNET <---> SQL server
. 重要的是,Web应用程序的流量不能通过VNET到达SQL服务器,因为Web应用程序不在VNET内,而是在VNET之外!因此,当您使用Web App时尝试访问SQL Server,流量不是来自VNET.
When all configurations are setup, your scenario should be Web App <---> VNET <---> SQL server
. The important thing is that the traffic from Web App cannot go trough the VNET to the SQL server, because the web App is not within the VNET, it's out side the VNET! So,When you use Web App try to access the SQL server, the traffic is not from the VNET.
解决方案:
解决方案是将您的Web应用程序放入VNet.因此,您可以使用 Azure ASE 来实现此目的
The solution is that put your Web App into the VNet. So, you can use Azure ASE to achieve this.
参考:
类似情况: App Service VNet集成使用Azure存储服务端点
这篇关于如何使用虚拟网络保护从App Service到Azure Sql数据库的访问安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!