Acess webapp from custom domain in private DNS

Sharma, Vaibhav 0 Reputation points
2021-03-23T18:02:07.367+00:00

I want a web app to be accessed by VMs in a vnet using custom domian in private DNS. I could access the webapp using custom domain in public DNS but I am not able to do it using private DNS.
I also created a private endpoint of the webapp in the same vnet but could not acess it from VMs in the vnet using private DNS.
Any help on this will be much appreciated.
Thanks.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
600 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
470 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. J 6 Reputation points
    2021-08-26T08:27:14.217+00:00

    Hi,

    I was able to do this using an app gateway (private ip) doing tls termination and host rewrite - front end had a cert issued by a trusted internal CA - so all internal systems accessing the app gateway front end were able to establish a tls session successfully, back end implicitly trusts the web apps cert due to it being issued by a public trusted root CA.

    I registered the front end of my app gateway private ip to my private DNS zone (webapp.sandbox.lab).

    The private endpoint automatically created the "privatelink.azurewebsites.net" private dns zone.

    Thanks,

    J

    1 person found this answer helpful.
    0 comments No comments

  2. ajkuma 22,521 Reputation points Microsoft Employee
    2021-03-24T13:07:21.107+00:00

    anonymous user, Thanks for the question. If you need to use a custom DNS name, you must add the custom name in your Web App. The custom name must be validated like any custom name, using public DNS resolution. How are accessing? Do you receive any error?

    You could With private DNS server (or an Azure DNS private zone), for tests you can modify the host entry of your test machine. -The DNS zone that you need to create is: privatelink.azurewebsites.net. Register the record for your Web App with a A record and the Private Endpoint IP. For example, the name resolution will be:

    | Name | Type | Value | Remark |
    | mywebapp.azurewebsites.net | CNAME | mywebapp.privatelink.azurewebsites.net | <--Azure creates this entry in Azure Public DNS to point the app service to the privatelink and this is managed by us |
    | mywebapp.privatelink.azurewebsites.net | A | 10.10.10.8 | <--You manage this entry in your DNS system to point to your Private Endpoint IP address |