azureazure-cognitive-searchazure-vpn

Connect to Azure Search Service using Azure VPN Client


I have configured an Azure VPN point to site connection to access my azure resources prtected by VNet from my local machine. I was able to access all other resources except Azure Search Service using VPN. For all the resoucres I added the GatewaySubnet under "Selected Networks" of Networking settings and also mentioned the corresponding resource's IP address as additional route in VNet Gateway.

But for azure search service I cannot add the GatewaySubnet under selected networks because search service allows only public IP address range to be added when selecting "Selected Networks".

I am getting below error when connecting to search service with VPN connected

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. System.Private.CoreLib: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Am I missing any setting? Can someone help me on this?


Solution

  • I was missing setting up the DNS forwarder. The public addresses are returned by Azure public DNS. The private addresses are returned by DNS internal to Azure. This means that we want to use DNS internal to Azure when accessing resources over a VPN connection. And this internal DNS provided by Azure is outside of our VNet and so we have to explicitly forward that using our own DNS forwarder. We must add a DNS server to the VNet if we want DNS support for P2S or S2S connections. We must stand up our own DNS Server, actually a forwarder, and add it to the VNG DNS server list. Azure does not provide any DNS server that is addressable from the VPN connection. We used azure firewall as a DNS forwarder and now everything works with VPN connected.