Rambalac
Rambalac

Reputation: 2861

How to access Azure VM from App Service in virtual network by private DNS name?

Problem is I can resolve neither myvm1 nor myvm1.priv.zone from App Service console by nameresolver.exe

UPDATE: Actually, the issue is even bigger. App Service is not able to send requests to VMs in Virtual Network by their Private IPs (10.1.x.x) even if everything is allowed on VMs' subnet. If the same requests are sent to VMs' Public IPs there is no problem. VNET Integration settings

Upvotes: 2

Views: 2568

Answers (2)

Nancy Xiong
Nancy Xiong

Reputation: 28294

As the existing answer, for scenario Name resolution from App Service Web Apps to VMs in the same virtual network. in this DOC, you need to deploy your own DNS server to help name resolution.

Here are the steps:

  1. On the Azure VM in the VNet, add a server role DNS server, after the installation, configure the DNS server, add Zone name such as qaz.lab in my example. You also can manually add an A record for your Azure VM in this Zone. enter image description here
  2. Add the DNS server private IP address in the custom DNS server of Azure VNet. Then restart the Azure VM to make it effective. enter image description here
  3. Configure VNet Integration with your app, in this case, select the new VNet integration. After that, refresh your VNet Integration. You will see the DNS server update in your app service plan --- networking. enter image description here
  4. Navigate your app service, run nameresolver FQDN to validate the DNS resolution. Currently, It only supports FQDN resolution. enter image description here

Let me know if you have any question.

Upvotes: 2

msrini-MSIT
msrini-MSIT

Reputation: 1502

As of today, you need to use DNS proxies or forwarders to achieve your ask. It is documented here in the scenario table.

For scenario "Name resolution from App Service Web Apps to VMs in the same virtual network.", the solution is to "Customer-managed DNS servers forwarding queries between virtual networks for resolution by Azure (DNS proxy)."

On How to perform "Name resolution with your own DNS" check here, where your scenario is described.

Upvotes: 0

Related Questions