How to minimize latency between Azure App Service and Azure SQL Database?
There's not a lot you can do to control the proximity of your VM to your SQL DB beyond ensuring they are in the same region and same availability zone if you use them. A few things to consider:
- You can enable accelerated networking on your VM to increase the network throughput
- If you're using any sort of VPN or Express Route to connect back to on-prem resources, make sure the traffic from IaaS VM to PaaS SQL is not being routed back on-prem and out the internet
- Look at using some of the diagnostic tools in Azure to measure performance, things like Azure Monitor, Network Watcher and the SQL monitoring tools to see if you can spot any issues