I have an app service in Azure (not in ASE App Service Env). It is integrated with a vnet.
And I have an API on-premises that this app must access by its internal on-prem DNS name.
And there is an Express Route between Azure and on-prem location.
How to access the on-prem API by its DNS name through an Express Route?
How to configure network connectivity?
How to resolve on-premises names in Azure?
There are different ways of achieving that, depending on your set-up.
You might need to use:
App Service
For App Services you must use Regional VNet integration.
If you need all traffic from the App Service to be routed via the Vnet, you must specify in the app service the setting WEBSITE_VNET_ROUTE_ALL = 1
DNS
Troubleshoot DNS in App Service
https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet#troubleshooting
Configure Peering
Route tables for VNets (not always necesary)
https://learn.microsoft.com/en-us/azure/virtual-network/manage-route-table