Access to Web App behind a private endpoint

%3CLINGO-SUB%20id%3D%22lingo-sub-2105997%22%20slang%3D%22en-US%22%3EAccess%20to%20Web%20App%20behind%20a%20private%20endpoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105997%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20deployed%20two%20web%20apps%20and%20a%20virtual%20machine%20and%20configured%20the%20resources%20to%20use%20the%20same%20virtual%20network%20(myvnet).%20The%20(Windows)%20web%20apps%26nbsp%3B%20have%20private%20endpoint%20connections%20configured%20with%26nbsp%3B%20names%20in%20a%20private%20DNS%20zone%20%22privatelink.azurewebsites.net%22.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20properly%20access%20the%20web%20apps%20from%20the%20virtual%20machine%3A%20The%20names%20%5Bwebapp-one%26nbsp%3B%20%2F%26nbsp%3B%20webapp-two%5D.azurewebsites.net%20are%20resolved%20to%20the%20internal%20ip%20addresses%20of%20the%20private%20endpoints%20as%20the%20vm%20uses%20the%20nameserver%20168.63.129.16.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20the%20web%20apps%20cannot%20access%20each%20other.%20In%20the%20code%20I%20try%20a%20HTTP%20Get%20request%20from%20the%20webapp-one%20application%20to%20%22%3CA%20href%3D%22https%3A%2F%2Fwebapp-two.azurewebsites.net%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwebapp-two.azurewebsites.net%3C%2FA%3E%22.%20This%20does%20not%20work%20and%20as%20far%20as%20I%20debugged%20this%20problem%20it%20seems%20that%20the%20name%20resolution%20is%20working%20properly.%20Instead%20of%20the%20internal%20ip%20address%20I%20get%20the%20external%20address%20(13.69.xx.yy).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20an%20idea%20where%20to%20look%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%2C%3C%2FP%3E%3CP%3EMatthias%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22apps_private_endpoints.png%22%20style%3D%22width%3A%20801px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F250246iC38F402DB4084EDB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22apps_private_endpoints.png%22%20alt%3D%22apps_private_endpoints.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2120134%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20to%20Web%20App%20behind%20a%20private%20endpoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2120134%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20DNS%20Private%20Zones%3C%2FP%3E%3CP%3EAfter%20your%20app%20integrates%20with%20your%20VNet%2C%20it%20uses%20the%20same%20DNS%20server%20that%20your%20VNet%20is%20configured%20with.%20By%20default%2C%20your%20app%20won't%20work%20with%20Azure%20DNS%20Private%20Zones.%20To%20work%20with%20Azure%20DNS%20Private%20Zones%2C%20you%20need%20to%20add%20the%20following%20app%20settings%3A%3C%2FP%3E%3COL%3E%3CLI%3EWEBSITE_DNS_SERVER%20with%20value%20168.63.129.16%3C%2FLI%3E%3CLI%3EWEBSITE_VNET_ROUTE_ALL%20with%20value%201%3C%2FLI%3E%3C%2FOL%3E%3CP%3EThese%20settings%20will%20send%20all%20of%20your%20outbound%20calls%20from%20your%20app%20into%20your%20VNet%20in%20addition%20to%20enabling%20your%20app%20to%20use%20Azure%20DNS%20private%20zones.%20These%20settings%20will%20send%20all%20the%20outbound%20calls%20from%20your%20app%20into%20your%20VNet.%20Additionally%2C%20it%20will%20enable%20the%20app%20to%20use%20Azure%20DNS%20by%20querying%20the%20Private%20DNS%20Zone%20at%20the%20worker%20level.%20This%20functionality%20is%20to%20be%20used%20when%20a%20running%20app%20is%20accessing%20a%20Private%20DNS%20Zone.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2122208%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20to%20Web%20App%20behind%20a%20private%20endpoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2122208%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F859787%22%20target%3D%22_blank%22%3E%40dontmentionme1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20getting%26nbsp%3B%3CSPAN%3E(13.69.xx.yy)%20because%26nbsp%3B%20you%20are%20not%20reaching%20the%20private%20endpoint%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ETo%20be%20able%20to%20reach%20the%20private%20endpoint%20you%20will%20need%20to%20integrater%20your%20app%20to%20the%20virtual%20network%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2F%2Fapp-service%2Fweb-sites-integrate-with-vnet%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2F%2Fapp-service%2Fweb-sites-integrate-with-vnet%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20the%20link%20above%20you%20will%20see%20this%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20your%20app%20integrates%20with%20your%20VNet%2C%20it%20uses%20the%20same%20DNS%20server%20that%20your%20VNet%20is%20configured%20with.%20By%20default%2C%20your%20app%20won't%20work%20with%20Azure%20DNS%20Private%20Zones.%20To%20work%20with%20Azure%20DNS%20Private%20Zones%2C%20you%20need%20to%20add%20the%20following%20app%20settings%3A%3C%2FP%3E%3COL%3E%3CLI%3EWEBSITE_DNS_SERVER%20with%20value%20168.63.129.16%3C%2FLI%3E%3CLI%3EWEBSITE_VNET_ROUTE_ALL%20with%20value%201%3C%2FLI%3E%3C%2FOL%3E%3CP%3EIf%20you%20want%20to%20make%20calls%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2F%2Fapp-service%2Fnetworking%2Fprivate-endpoint%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPrivate%20Endpoints%3C%2FA%3E%2C%20then%20you%20need%20to%20ensure%20that%20your%20DNS%20lookups%20will%20resolve%20to%20the%20private%20endpoint.%20To%20ensure%20that%20the%20DNS%20lookups%20from%20your%20app%20will%20point%20to%20your%20private%20endpoints%20you%20can%3A%3C%2FP%3E%3CUL%3E%3CLI%3Eintegrate%20with%20Azure%20DNS%20Private%20Zones.%20If%20your%20VNet%20doesn't%20have%20a%20custom%20DNS%20server%2C%20this%20will%20be%20automatic%3C%2FLI%3E%3CLI%3Emanage%20the%20private%20endpoint%20in%20the%20DNS%20server%20used%20by%20your%20app.%20To%20do%20this%20you%20need%20to%20know%20the%20private%20endpoint%20address%20and%20then%20point%20the%20endpoint%20you%20are%20trying%20to%20reach%20to%20that%20address%20with%20an%20A%20record.%3C%2FLI%3E%3CLI%3Econfigure%20your%20own%20DNS%20server%20to%20forward%20to%20Azure%20DNS%20private%20zones%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E
Frequent Visitor

Hello everyone,

 

I deployed two web apps and a virtual machine and configured the resources to use the same virtual network (myvnet). The (Windows) web apps  have private endpoint connections configured with  names in a private DNS zone "privatelink.azurewebsites.net". 

 

I can properly access the web apps from the virtual machine: The names [webapp-one  /  webapp-two].azurewebsites.net are resolved to the internal ip addresses of the private endpoints as the vm uses the nameserver 168.63.129.16.

 

But the web apps cannot access each other. In the code I try a HTTP Get request from the webapp-one application to "https://webapp-two.azurewebsites.net". This does not work and as far as I debugged this problem it seems that the name resolution is working properly. Instead of the internal ip address I get the external address (13.69.xx.yy).

 

Does anyone have an idea where to look?

 

Thanks in advance,

Matthias

 

apps_private_endpoints.png

 

2 Replies

Azure DNS Private Zones

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:

  1. WEBSITE_DNS_SERVER with value 168.63.129.16
  2. 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. These settings will send all the outbound calls from your app into your VNet. Additionally, it will enable the app to use Azure DNS by querying the Private DNS Zone at the worker level. This functionality is to be used when a running app is accessing a Private DNS Zone.

@dontmentionme1 

Hi 

You are getting (13.69.xx.yy) because  you are not reaching the private endpoint 

To be able to reach the private endpoint you will need to integrater your app to the virtual network 

https://docs.microsoft.com/en-us/azure//app-service/web-sites-integrate-with-vnet

In the link above you will see this : 

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:

  1. WEBSITE_DNS_SERVER with value 168.63.129.16
  2. WEBSITE_VNET_ROUTE_ALL with value 1

If you want to make calls to Private Endpoints, then you need to ensure that your DNS lookups will resolve to the private endpoint. To ensure that the DNS lookups from your app will point to your private endpoints you can:

  • integrate with Azure DNS Private Zones. If your VNet doesn't have a custom DNS server, this will be automatic
  • manage the private endpoint in the DNS server used by your app. To do this you need to know the private endpoint address and then point the endpoint you are trying to reach to that address with an A record.
  • configure your own DNS server to forward to Azure DNS private zones