简体   繁体   English

Azure App Service VNET 集成和网络优化

[英]Azure App Service VNET integration and network optimization

An Azure support engineer suggested that I put two app services on the same VNET in order to optimize my traffic.一位 Azure 支持工程师建议我将两个应用服务放在同一个 VNET 上以优化我的流量。 I'm new to VNETs so I'm trying to grok how this works.我是 VNET 的新手,所以我试图了解它是如何工作的。 So far I've successfully added both the app services to the same VNET.到目前为止,我已经成功地将这两个应用服务添加到同一个 VNET。 However, it's unclear to me if it's "working" or not.但是,我不清楚它是否“工作”。 I've tried reading the docs but they are incredibly dense and difficult for me to see the forest for the trees.我试过阅读文档,但它们非常密集,我很难只见树木不见森林。 So here's where I'm at:所以这就是我所在的位置:

Based on what I've read it seems like if services are in the same VNET the traffic between them will be routed differently.根据我读到的内容,如果服务在同一个 VNET 中,它们之间的流量将以不同的方式路由。 For example, say I have two services: service1.mydomain.com and service2.mydomain.com .例如,假设我有两个服务: service1.mydomain.comservice2.mydomain.com Service 1 makes calls to service 2 via the service2.mydomain.com url.服务 1 通过service2.mydomain.com url 调用服务 2。 Normally, that traffic would go all the way back out to the internet and back in. But it sounds like just by adding them to the same VNET the traffic is somehow routed differently on an optimized and cheaper path.通常,该流量将 go 一直返回到 Internet 并返回。但听起来就像只是将它们添加到同一个 VNET 中,流量会以某种方式在优化且更便宜的路径上以不同的方式路由。 Is that accurate or is there more configuration required?这是准确的还是需要更多的配置? If so, how can I verify that it's working?如果是这样,我如何验证它是否有效?

Thanks!谢谢!

Support is correct.支持是正确的。 Since both these services are on the same VNET, traffic will not flow outside the VNET and will be optimized.由于这两个服务都在同一个 VNET 上,因此流量不会流到 VNET 之外,并且会被优化。 This is because the default routes for all VNETs have a route with a next hop of Virtual Network .这是因为所有 VNET 的默认路由都有一个下一跳为Virtual Network的路由。

Virtual network: Routes traffic between address ranges within the address space of a virtual network.虚拟网络:在虚拟网络的地址空间内的地址范围之间路由流量。 Azure creates a route with an address prefix that corresponds to each address range defined within the address space of a virtual network. Azure 创建一个路由,其地址前缀对应于虚拟网络地址空间中定义的每个地址范围。 If the virtual network address space has multiple address ranges defined, Azure creates an individual route for each address range.如果虚拟网络地址空间定义了多个地址范围,Azure 将为每个地址范围创建单独的路由。 Azure automatically routes traffic between subnets using the routes created for each address range. Azure 使用为每个地址范围创建的路由自动在子网之间路由流量。 You don't need to define gateways for Azure to route traffic between subnets.您无需为 Azure 定义网关即可在子网之间路由流量。 Though a virtual network contains subnets, and each subnet has a defined address range, Azure does not create default routes for subnet address ranges, because each subnet address range is within an address range of the address space of a virtual network.尽管虚拟网络包含子网,并且每个子网都有定义的地址范围,但 Azure 不会为子网地址范围创建默认路由,因为每个子网地址范围都在虚拟网络地址空间的地址范围内。

https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview

It depends on the App Service Plan you're using for your App Service.这取决于您用于应用服务的应用服务计划。 If you're using Azure App Services on an App Service Environment, you'll have your own VNet for routing and it should work like that (I'm not too familiar with ASEs) However, if you're using a Premium or lower tier, VNet integration is only useful for outbound calls, meaning that an App Service will be able to access resources on that VNet, but other integrated App Services are not on that VNet, they are just able to access resources on it as well ( https://docs.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet ).如果您在应用服务环境中使用 Azure 应用服务,您将拥有自己的用于路由的 VNet,并且它应该像那样工作(我对 ASE 不太熟悉)但是,如果您使用的是高级或更低层,VNet 集成仅对出站调用有用,这意味着应用服务将能够访问该 VNet 上的资源,但其他集成的应用服务不在该 VNet 上,它们也只能访问其上的资源 ( https ://docs.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet )。 If you want the App Services to be accessed through that VNet you'll need to set up Service Endpoints or Private Endpoints.如果希望通过该 VNet 访问应用服务,则需要设置服务终结点或专用终结点。 See https://docs.microsoft.com/en-us/azure/app-service/networking-features for more details有关详细信息,请参阅https://docs.microsoft.com/en-us/azure/app-service/networking-features

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM