Hi @Ashwin
Thanks for the question and using MS Q&A platform.
To resolve the connectivity issue between your Azure Web App in East US and the PostgreSQL Flexible Server in SouthEast Asia, follow these steps:
1.Verify VNet Peering Configuration
Ensure that the VNet peering between the two regions is correctly set up:
Allow Forwarded Traffic: Confirm that the peering configuration allows forwarded traffic. This setting is crucial for communication between resources in different VNets.
2.Use Remote Gateways: If necessary, enable the option to use remote gateways.
Check Firewall Settings
Since your PostgreSQL server is likely configured for private access:
Add Web App IP Addresses: Include the outbound IP addresses of your Azure Web App in the firewall rules of your PostgreSQL server. This can be done in the Azure Portal under the PostgreSQL server's networking settings.
3.Allow Azure Services: Optionally enable "Allow Azure services and resources to access this server" to simplify connectivity.
4.Enable VNet Integration for Your Web App
Integrate your Azure Web App with the VNet where your PostgreSQL server resides:
VNet Integration: Use Azure CLI or the Azure Portal to integrate your web app with the appropriate VNet. This enables private connectivity to your PostgreSQL server.
- Configure Connection Strings
Make sure that your application uses the correct connection string format to connect to the PostgreSQL server:
- Use the fully qualified server name and ensure SSL is enabled.
Host=<your-server-name>.postgres.database.azure.com;Username=<your-admin-username>;Password=<your-password>;Database=<your-database-name>;SSL Mode=Require;
Troubleshoot a connectivity issue between two peered virtual networks
Troubleshoot connection issues to Azure Database for PostgreSQL - Flexible Server
Connect Azure Database for PostgreSQL - Flexible Server with the private access connectivity method