Above is my network architecture. I'm connecting to a Azure Postgres Database (Version 11) from an AKS pod through private endpoint and facing the below error.
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "mypsg11privendpoint.com" (172.21.56.70), port 5432 failed: FATAL: Client from Azure Virtual Networks is not allowed to access the server using Private IP. Please make sure your Virtual Network is correctly configured.
Now the more surprising part is The same pod is able to connect to postgres server (Version 9.6) through private endpoint. The NIC for both private endpoints reside in the same subnet and has the same NSG.
Below are some of the factors I've already checked and implemented.
- AKS pod Subnet has Service-Endpoint
Microsoft.sql
enabled. - Postgres Server has VNET rule referring to the AKS subnet.
- Deny Public network Access set to "No" (Even though I'm using private endpoint I still set this to "no" for now)
Still I'm facing the same error when connecting to the version 11 DB. The only difference between the two dbs are it's version. Have I missed any other additional setting here? Does version 11 have any other additional firewall inside the DB?