Azure PostgreSQL flexible Server Database Managed Identity connection

Maruthuvel Ramachandran 5 Reputation points


-We have created Azure postgres Flexible server with Microsoft Entra Authentication only deployment as Paas in Azure subscription.
-We have added Azure Service Principal into Database admin user via Azure portal.

  • We have created Azure VM and Azure container and Azure Postgres Flexible DB all the three resources are crated in the same Vnet with different subnets.
  • To connect Database withing the same Vnet , you have crated the DNS private link
  • You have installed Pg Admin in Azure VM then connecting postgres flexible server using SPN with token
  • Create the user for Azure system managed Identity and assign role with Azure_pg_admin.
  • In Azure Container App add all env variable for example db user name
  • After deployment application container got failed with FATAL error like as "Psql Exception Fatal Pg_hba.conf rejects connections for the host with user and dbname and SSL encription."
  • Any input it would be appreciated.
Azure Database for PostgreSQL
{count} vote

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,196 Reputation points Microsoft Employee

    Hi Maruthuvel Ramachandran,

    Please try to check if details inside your app are correctly given.

    Check permissions and network aspects too.

    Try to enable detailed logging for the PostgreSQL server to capture more information about the connection attempts and reasons for rejection.

    It is recommended to create support case for understanding your scenario and set-up since it involves multiple services and and in case if you don't have a support plan, do let us know here so that we can check on other options to unblock you.


    0 comments No comments