Unable to connect to Azure Database for PostgreSQL: password authentication failed

Zakir A Siddiqi 0 Reputation points
2025-12-17T00:12:14.5633333+00:00

I’m working with an Azure Database for PostgreSQL instance (socal-intel-db.postgres.database.azure.com) and consistently receive the following error when trying to connect:

psql "host=socal-intel-db.postgres.database.azure.com port=5432 dbname=postgres user=zadmin1@socal-intel-db sslmode=require"

Password: <entered>

psql: error: connection to server at "socal-intel-db.postgres.database.azure.com" (13.64.13.225), port 5432 failed:

FATAL: password authentication failed for user "zadmin1@socal-intel-db"

What I’ve tried

Reset the admin password multiple times in the Azure Portal.

Verified firewall rules (enabled “Allow Azure services to connect”).

Confirmed SSL mode is required and included sslmode=require.

Tested from Cloud Shell and Codespaces.

Verified schema creation works locally when connected to a different Postgres instance.

Question

Has anyone seen password resets not propagate correctly in Azure Database for PostgreSQL? Could there be a subtle difference in the username format (e.g., zadmin1@socal-intel-db vs. ******@socal-intel-db.postgres.database.azure.com) that I’m missing? Any guidance on how to confirm the correct admin username or force a credential sync would be greatly appreciated.

Azure Database for PostgreSQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-17T00:12:30.14+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    When encountering the "password authentication failed for user" error in Azure Database for PostgreSQL, there are a few potential causes and solutions to consider:

    1. Incorrect Password: Ensure that the password you are entering is correct. If you have reset the password multiple times, double-check that you are using the most recent password.
    2. Username Format: The username format is crucial. In Azure Database for PostgreSQL, the username should typically be in the format username@servername. In your case, it should be zadmin1@socal-intel-db. Make sure you are not mistakenly using the full server name in the username when connecting.
    3. Connection Tool: If you are using a specific tool to connect, try using a different one (like psql or pgAdmin) to rule out client-specific issues. This can help determine if the problem is with the client or the server settings.
    4. Firewall Rules: Since you have already verified the firewall rules, ensure that the IP address from which you are connecting is allowed. You might also want to check if there are any additional network security settings that could be blocking the connection.
    5. SSL Configuration: Since you are using sslmode=require, confirm that your client supports SSL connections and that the server is configured to accept them. If necessary, try connecting without SSL to see if that changes the outcome.
    6. Password Reset Propagation: Sometimes, there can be delays in password resets propagating through the system. If you suspect this might be the case, try waiting a short period before attempting to connect again.
    7. Log Capturing: Enable log capturing to monitor any unauthorized access attempts or errors that might give more insight into the issue. This can help identify if there are any patterns or specific IP addresses involved in the failed attempts.

    If you continue to face issues after checking these points, consider filing a support ticket with Azure for further assistance.


    References:

    0 comments No comments

  2. Pilladi Padma Sai Manisha 595 Reputation points Microsoft External Staff Moderator
    2025-12-17T00:41:17.9233333+00:00

    Hi Zakir A Siddiqi,

    It sounds like you're having a frustrating time connecting to your Azure Database for PostgreSQL, especially with the password authentication failing. Here are a few things you can check and try based on your setup:

    1. Username Format: Make sure you're using the correct format for your username when connecting. It should be in the form of username@servername, so for you, it should be zadmin1@socal-intel-db rather than just zadmin1. Double-check this as it’s a common source of errors.
    2. Password Verification: Since you've reset the admin password multiple times, ensure that you are inputting the latest password without any typographical errors. You might want to test the password by connecting using a different tool like psql or pgAdmin to determine if the issue is specific to your current setup.
    3. Check Firewall Rules: You've verified that "Allow Azure services to connect" is enabled, but also ensure that your client IP address is included in the firewall rules. Go into the Azure Portal to confirm this.
    4. SSL Mode: Since you confirmed SSL mode is required, make sure you're executing the command with sslmode=require. You can specify the SSL mode directly in your connection string.
    5. Failed Connection Count: Use the server's metrics to check how many failed connections are recorded in the past 24 hours. This can give you insights into whether your connection attempts are even reaching the server.
    6. Passwordless Authentication: If you're interested in upgrading your security, consider using passwordless connections to your PostgreSQL database, which can be more secure and eliminate issues related to password management.

    Follow-Up Questions:

    • Have you tried connecting with a different PostgreSQL client tool to see if the problem persists?
    • Can you confirm if any recent changes were made to either the username or the connection string?
    • Are you connecting from an IP that is covered by any existing firewall rules you set up?
    • Were there any changes in the settings of the Azure Database or its network rules around the time the authentication issues began?

    I hope these tips help you out! If you're still stuck, feel free to provide more details, and we can dig deeper into the issue.

    References:

    Let me know if you need more information!

    0 comments No comments

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.