Allowing connection on postgres flexi database for Azure to some application on different VNET

117 Views Asked by At

I have "Azure Database for PostgreSQL Flexible server" provisioned with authentication I am able to connect to that DB from my local environment Secondly I have application on another VNET and VM which I manage and is again connecting fine from my local How should these 2 VNETS be connected by following best practice, so that my app from one VNET can access source DB on another VNET (and region)?

Update, Permission needed please see attached When I try to add peering for remote database hosted vnet, it expects me to have access there. This doesn't sound right, as same person dont have to access to both of the vnets. My access to DB is at postgres level auth enter image description here

1

There are 1 best solutions below

3
Venkat V On

Allowing connection on postgres flexi database for Azure to some application on different VNET

To connect your application on one VNet with the Azure Database for PostgreSQL Flexible server on a different VNet, you can use VNet peering for establishing a secure connection between two VNets in the same or different regions.

Here are the steps to configure VNet peering between the two VNets.

  1. To create a VNet peering connection between two VNets, follow steps below.

Azure Portal > Virtual network > select Vnet > Peerings

enter image description here

After configuring the VNet peering, please verify the peering status.

enter image description here

  1. To allow traffic from the VNet where your application is located, create and configure the network security group rules for the Azure Database for PostgreSQL Flexible server.

After creating the NSG, associate it with the PostgreSQL Flexible subnet and then create an NSG rule to allow traffic from the VNet where your application resides.

enter image description here

For more details, follow Ms. Doc for a detailed explanation about Azure Database for PostgreSQL - Flexible Server with private access (VNET Integration).

Azure Database for PostgreSQL - Flexible Server networking with Private Link - Preview