Azure web app and azure database for postgres

Milestone IT 20 Reputation points
2023-12-19T09:20:41.5+00:00

i have created a web app and uploaded laravel application and created an azure database for postgres and uploaded postgres database there. i cant connect them both. if i try to fetch details from database,

{"message":"Accounts can\u2019t be retrieved","error":"SQLSTATE[08006] [7] FATAL:  password authentication failed for user \"postgres\"\nFATAL:  no pg_hba.conf entry for host \"111.92.77.167\", user \"postgres\", database \"zerobooks001_data\", no encryption (Connection: pgsql, SQL: select * from \"accounts\")"}   this is the error message am getting
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2023-12-21T17:11:22.66+00:00

    @Milestone IT It seems like there is an issue with the authentication of the user "postgres" when trying to connect to the Azure Database for PostgreSQL.

    To resolve this issue, you can try the following steps:

    Check if the firewall rules are configured correctly to allow connections from your web app to the Azure Database for PostgreSQL. You can do this by going to the Azure portal, selecting your Azure Database for PostgreSQL, and then checking the firewall settings.

    Make sure that the connection string in your Laravel application is correct and includes the correct username and password for the PostgreSQL database. You can find the connection string in the Azure portal under the "Connection strings" section of your web app.

    1. See if the PostgreSQL server is configured to allow connections from your web app. You can do this by going to the Azure portal, selecting your Azure Database for PostgreSQL, and then checking the server settings.
    2. Lastly, please ensure the PostgreSQL server is running and that the database is accessible. You can do this by connecting to the PostgreSQL server using a tool like pgAdmin or psql.
    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.