Verify virtual network integration
To troubleshoot the connection issues, you must first verify whether the virtual network integration is configured correctly and whether the private IP is assigned to all instances of the App Service Plan.
Check the private IP in the Kudu Debug console
To access the Kudu console, select the app service in the Azure portal, go to Development Tools, select Advanced Tools, and then select Go. In the Kudu service page, select Tools > Debug Console > CMD.
To troubleshoot the connection issues, you must first verify whether the virtual network integration is configured correctly and whether the private IP is assigned to all instances of the App Service Plan.
Check the private IP in the Kudu Debug console
To access the Kudu console, select the app service in the Azure portal, go to Development Tools, select Advanced Tools, and then select Go. In the Kudu service page, select Tools > Debug Console > CMD.
You can also go to the Kudu Debug console directly by the URL [sitename].scm.azurewebsites.net/DebugConsole.
In the Debug console, run one of the following commands:
Windows OS-based apps
Console
SET WEBSITE_PRIVATE_IP
If the private IP is assigned successfully, you'll get the following output:
Output
WEBSITE_PRIVATE_IP=<IP address>
Linux OS-based apps
Console
set| egrep --color 'WEBSITE_PRIVATE_IP'
Check the private IP in the Kudu environment
Go to the Kudu environment at [sitename].scm.azurewebsites.net/Env and search for WEBSITE_PRIVATE_IP.
Once we've established that the virtual network integration is configured successfully, we can proceed with the connectivity test.
Troubleshoot outbound connectivity on Windows Apps
In native Windows Apps, the tools ping, nslookup, and tracert won't work through the console because of security constraints (they work in custom Windows Containers).
Go to the Kudu console directly at [sitename].scm.azurewebsites.net/DebugConsole.
To test DNS functionality, you can use nameresolver.exe. The syntax is:
Console
nameresolver.exe hostname [optional:DNS Server]
You can use nameresolver to check the hostnames that your app depends on. This way, you can test if you have anything misconfigured with your DNS or perhaps don't have access to your DNS server. You can see the DNS server that your app uses in the console by looking at the environmental variables WEBSITE_DNS_SERVER and WEBSITE_DNS_ALT_SERVER.
Note: The nameresolver.exe tool currently doesn't work in custom Windows containers.
To test TCP connectivity to a host and port combination, you can use tcpping. The syntax is.
Console
tcpping.exe hostname [optional: port]
The tcpping utility tells you if you can reach a specific host and port. It can show success only if there's an application listening at the host and port combination and there's network access from your app to the specified host and port.
Troubleshoot outbound connectivity on Linux Apps
Go to Kudu directly at [sitename].scm.azurewebsites.net. In the Kudu service page, select Tools > Debug Console > CMD.
To test DNS functionality, you can use the command nslookup. The syntax is:
Console
nslookup hostname [optional:DNS Server]
Depending on the above results, you can check if there's something misconfigured on your DNS server.
Note: The nameresolver.exe tool currently doesn't work in Linux apps.
To test connectivity, you can use the Curl command. The syntax is:
Console
curl -v https://hostname
curl hostname:[port]
source : Microsoft Azure App Services
0 Comments