I have just set up a fresh Azure for PostgreSQL Flexible Server and selected to place it on my VNet rather than whitelisting with public IPs. It is on its own subnet and assigned the Storage and .SQL Service Endpoints.
I also have a NodeJS API deployed in Azure App Service which is attached to the same VNet on its own subnet.
If done no additional NSG, routes, or firewall rules as what I’ve read leads me to think that my resources should be able to talk to eachother just based on the configurations above.
When I SSH into my App Service container and try to migrate my database (using the FQDN of the server brought in via Environment Variable), it tells me instantly that the name cannot be found. I also try to ping the FQDN of database, same error.
I’m unsure what else is needed to make these two connect, but I’m quite stuck. Any guidance would be greatly appreciated.
You could follow this Tutorial: Create an Azure Database for PostgreSQL - Flexible Server with App Services Web App in Virtual network to add Azure Flexible Server to a VNet. If you have done, you will find that subnet delegated to Microsoft.DBforPostgreSQL/flexibleServers
and enabled service endpoint Microsoft.Storage
.
Also, in this case of vnet integration with web app, By default, BGP routes affect only your RFC1918 destination traffic. When WEBSITE_VNET_ROUTE_ALL
is set to 1
, all outbound traffic from the app service can be affected by your BGP routes. Refer here.
After following the steps in that tutorial and adding WEBSITE_VNET_ROUTE_ALL
with value 1
in the app settings, I can access the Azure for PostgreSQL Flexible Server from the SSH tool in App Service container.