Azure Database for PostgreSQL error: FATAL: password authentication failed for user

ericOnline 21 Reputation points
2024-07-23T21:38:42.51+00:00

Hello,

For some reason, my Azure Function with System Assigned Managed Identity cannot access my Azure Database for PostgreSQL resource.

Error:

Failed to create PSQL Client: connection to server at "
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,110 questions
Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 27,921 Reputation points
    2024-07-24T08:55:34.1066667+00:00

    @ericOnline Thanks for reaching out. It looks like you are experiencing an issue where your Azure Function with System Assigned Managed Identity cannot access your Azure Database for PostgreSQL resource.

    could you please confirm if you have followed the below steps

    1. Go to your Azure Function in the Azure portal.
    2. Click on "Identity" and then select "System assigned".
    3. Click on "Save" to save the changes.
    4. Go to your Azure Database for PostgreSQL resource in the Azure portal.
    5. Click on "Access control (IAM)" and then click on "Add".
    6. In the "Add role assignment" blade, select "Contributor" as the role and then search for your Azure Function by name.
    7. Select your Azure Function and then click on "Save" to grant the Contributor role to your Azure Function.
    0 comments No comments

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.