Share via

entraid authentication for postgresql flexible srver seems broken for new fresh postgresql

gabriel cuadros 0 Reputation points
2026-02-12T22:28:38.6533333+00:00

i tried to check why my entraid auth was not working, i been spinning different version but all the same issues

Connection error: connection failed: connection to server at "xxxxxxx", port 5432 failed: FATAL: password authentication failed for user "xxxxxx"

i addded all the ip in case is networking issues , i cna login use user and password and configure the following but cannot login with any entraid user

on master postgres
CREATE ROLE "xxxx" WIT LOGIN

also tried
select * from pgaadauth_create_principal('xxxxx', false, false);

then

GRANT CONNECT ON DATABASE demo TO "xxxxx";


on destination db

GRANT USAGE ON SCHEMA public TO "xxx";

GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO "xxxxx";

then to connect i tried

PGPASSWORD="$(az account get-access-token --resource https://ossrdbms-aad.database.windows.net --query accessToken --output tsv)"

psql "sslmode=require host=xxxx.postgres.database.azure.com dbname=postgres user=xxxx" -W

What is happenign or what i am doing wrong?

Azure Database for PostgreSQL

1 answer

Sort by: Most helpful
  1. Manoj Kumar Boyini 14,495 Reputation points Microsoft External Staff Moderator
    2026-02-12T22:41:35.5566667+00:00

    Hi gabriel cuadros,

    Please reset the PostgreSQL server administrator password and reconnect using the updated credentials. This should resolve the authentication failure.

    Hope this helps, Please let us know if you have any questions and concerns.

    If this solution helped resolve your issue, please consider clicking ‘Accept Answer’ or giving it an upvote to help others find it easily.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.