Unable to authenticate using entra id in logical replication mode

Shiva Vanamala 5 Reputation points
2024-08-23T11:01:30.75+00:00

Authentication mechanism: Entra ID authentication

User type: entra ID user. alter role with replication

Connect to the server using command (after logging in):
$ psql "host=test.postgres.database.azure.com port=5432 dbname=postgres user=entra_user@xxx.com password='$(az account get-access-token --resource-type oss-rdbms --output tsv --query accessToken)' sslmode=require replication=database" psql: error: connection to server at "test.postgres.database.azure.com" (xxx.xxx.xxx.xxx), port 5432

Error:
failed: FATAL: password authentication failed for user "entra_user@xxx.com"

The reason for the failure seems to be that, Entra ID authentication on Azure Postgres FS is only supported for authentication using CLEARTEXT_PASSWORD. However, in logical replication mode, the required authentication is MD5_PASSWORD

Azure Database for PostgreSQL
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,065 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 19,506 Reputation points Microsoft Employee
    2024-08-23T18:29:33.3433333+00:00

    @Shiva Vanamala Thank you for reaching out.

    Currently, it is not possible to use MSFT Entra users for logical replication in Azure Database for PostgreSQL flexible server. For example, if the token expires and connections need to be re-established, it won't be possible to retrieve the token itself, which would disrupt the replication process.  While MSFT Entra integration in Azure Database for PostgreSQL offers benefits for user authentication and authorization, it is not designed for direct use in replication scenarios.

    Regards,

    Oury


Your answer

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