Problem Outline
Azure Function App can not be accessed once it is integrated into a VNET and WEBSITE_VNET_ROUTE_ALL is set to 1.
This is required so that the Function App can securely connect to SQL without making the SQL publicly available.
Errors:
Unable to list Function App keys.
HTTP Request (CURL) from within VM in same network fails: 504 Gateway Timed out
Architectural Diagram
Steps to reproduce
Through an SSH connection into the Function App and with nslookup we determined that the connection to the private link resolves the local IP address of the SQL database as expected.
Setting the WEBSITE_VNET_ROUTE_ALL flag to 0, nslookup resolves the public IP of the SQL database.
As the SQL database is restricted and only available on the network, it is vital that the WEBSITE_VNET_ROUTE_ALL setting is set to 1.
WEBSITE_VNET_ROUTE_ALL = 1
WEBSITE_VNET_ROUTE_ALL = 0
References
https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet
This was resolved by adding a "Microsoft.Storage" service endpoint to the Function App subnet.
When all of the traffic is sent into the vnet, it needs a service endpoint to Storage so that it can read the Function App configuration and functions.