简体   繁体   中英

App Service not able to connect to resources through VPN Connection

I've got a Web API (.NET Core 3.1) running on an App Service and I am not able to send data to an external API present on another server outside Azure.

The Virtual Network Gateway is assigned with the VNet and 2 external Connections and both are working well (status Connected). I can ping services and access the resources from the office.

The VPN Connection is a Site-to-Site VPN in the same VNet. It is working fine and I can send the data if I run my API on a VM in Azure .

Looks like the App Service cannot see the network in the same way the VM does.

What should I do to get the App Service to be able to utilise the VPN Connection?

It seems that you want to app service access resources in on-premise network, I supposed you have integrated you app with an Azure virtual network and set up Site-to-Site VPN in the same VNet.

Make sure that you have set the app setting WEBSITE_VNET_ROUTE_ALL to 1

When regional VNet Integration is enabled, your app makes outbound calls to the internet through the same channels as normal. The outbound addresses that are listed in the app properties portal are the addresses still used by your app. What changes for your app are the calls to service endpoint secured services, or RFC 1918 addresses go into your VNet. If WEBSITE_VNET_ROUTE_ALL is set to 1 , all outbound traffic can be sent into your VNet.

WEBSITE_VNET_ROUTE_ALL is currently not supported in Windows containers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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