mahendra rathod
mahendra rathod

Reputation: 1638

Unable to connect Azure Database for PostgreSQL servers from Azure function app

We have created the Vnet with virtual network gateway for point to site VPN, PostgresDB, Azure function APP.

We are able to establish connections with a point-to-site VPN.

Configuration:

If in PostgresDB we configured Deny public network to "No" then azure function communicating to Postgres DB and works find.

Issue :

when we are trying to access Azure DB from Private function with hostname its failed to establish the connection but it works if we replace Azure DB hostname with private IP.

Same with VPN connection when we try to connect Postgress DB with server name it doesn't work but works with private endpoint IP.

Error:-

Result: Failure Exception: OperationalError: FATAL: The public network access on this server is disabled. To connect to this server, use the Private Endpoint from inside your virtual network.

we need a solution to create a connection between the azure function to private Postgres DB.

Upvotes: 1

Views: 1450

Answers (1)

Bharat Gadade
Bharat Gadade

Reputation: 657

In order to solve the above issue, please check the below points.

  1. Enable private endpoint at Azure Function & DB
  2. If you are denying the public network access to 'Yes' then you need to make allow Azure Service to 'Yes' and add Vnet Rule with function subnet.
  3. Go to the private DNS zones and check vnet(Vnet in which DB & Function created) are added into the private DNS zone.

Upvotes: 0

Related Questions