Reputation: 1
I have question regarding how to setup DNS hostname resolution using VNet Integration in Azure.
I have an App Service Plan web site. I have VNet Integration enabled into my VNet. My VNet has its own DNS Server and it is configured to use it. I tried to use a Private DNS Zone as well. Neither of these solutions are providing the means for my web app to connect to my API hosted on a VM in my VNet. The browser can't resolve the hostname of the API. The error message is
ERR_NAME_NOT_RESOLVED.
Apart from enabling VNet Integration and having a dedicated a DNS Server. What other configuration is necessary to have DNS working through VNet Integration?
All outbound traffic is enabled in the VNet Integration to go into the VNet.
Upvotes: 0
Views: 1275
Reputation: 8195
Make sure your API hosted in a VM and Web app are in the same V-NET and there's a dedicated subnet created for Web App while integrating the Web app with the V-NET.
Referring to ajkuma suggestions in this MS Q & A Forum:- DNS Hostname Resolution from App Service Plan using VNet Integration - Microsoft Q&A
In order to troubleshoot the issue you can visit > your App > Diagnose and solve problems > Diagnostic Tools >
Select Connection issues and check the recommendation for more insights.
I created one API in my Azure VM refer below:-
Called that API from azure Web app as Azure Web app has V-NET integrated with VM.
Make sure you have your DNS cache is cleared by running the below command in your debug console:-
ipconfig /flushdns
Make sure your Web app code has correct connection string to connect to your API.
Also, Validate if your DNS is resolving to the correct hostname of your API.
For Private DNS Zone make sure its resolving correctly with your API and then configure the same V-NET as your Web app with the Private DNS zone.
Reference:-
Azure App Service virtual network integration troubleshooting guide - Azure | Microsoft Learn
Upvotes: 0