Azure App Service unable to resolve hostname of Virtual Machine on Vnet

James Fleming 21 Reputation points
2020-09-03T08:13:49.7+00:00

I have setup a virtual machine on a vnet to which an app service is connected to via vnet integration. The app service is able to connect to the virtual machine when using its private IP address, but unable to when using its hostname or FQDN. All services are using the Azure provided DNS.

How can I resolve the virtual machine via its hostname rather than relying on its (dynamic) private IP address?

Many thanks,
James

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
1,182 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,612 questions
Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
396 questions
No comments
{count} votes

Accepted answer
  1. Didier3001 891 Reputation points Microsoft Employee
    2020-09-06T11:50:44.497+00:00

    Hi @James Fleming

    I believe you will need to configure the following for this to work:

    "After your app integrates with your VNet, it uses the same DNS server that your VNet is configured with. By default, your app won't work with Azure DNS Private Zones. To work with Azure DNS Private Zones you need to add the following app settings:

    WEBSITE_DNS_SERVER with value 168.63.129.16
    WEBSITE_VNET_ROUTE_ALL with value 1
    These settings will send all of your outbound calls from your app into your VNet in addition to enabling your app to use Azure DNS private zones."

    https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet#azure-dns-private-zones

    --I hope this helps. Please do not forget to "Accept the answer" and "Up-Vote" the answer or message(s) that helped you so that it can help others in the community looking for help on similar topics

    Regards,
    Didier3001

    No comments

0 additional answers

Sort by: Most helpful