1

I am using psql on Azure. While I am successfully able to connect it on CLI and using Python psycopg2 or other modules and library, I am facing issue connecting it to the pgadmin Web UI.

The process to connect to the Azure POSTGRES in pgadmin is as follows:

  1. Click on Add New Server.
  2. Provide Name under General tab.
  3. Provide Host, Port, DB Name, Username, Password.

After clicking on Save, it always pops connection timeout error.

While with the above config I can connect to it in the python, create cursor and commit a query. Do we require additional settings to be done for connecting it to the pgadmin. I am new to cloud and not sure if there is some additional security checks like token access to be provided or something.

1
  • Are psql (the CLI program) and psycopg2 running on your local machine when you can connect, or are they running on a ssh window logged in to some other machine? Commented Mar 4, 2021 at 18:25

3 Answers 3

4

Please have a check that have you enabled your local public IP address in Postgres DB Firewall rules? enter image description here After I created the new DB and added my local public IP to Firewall rules, I can connect to DB by local pgAdmin successfully:

enter image description here Configs: enter image description here enter image description here

Sign up to request clarification or add additional context in comments.

Comments

2

Under settings. Click on Networking. you will find a link like '+ Add current client IP address ( 119.160.103.152 ) + Add 0.0.0.0 - 255.255.255.255' click on it and use 0.0.0.0 to allow all public ip addresses. Now try to connect. enter image description here

Above answer is correct but look at he above link now option for public ip is under Network option. Connected success fully after doing this.

Comments

0
  1. Allow your IP address in Azure postgresDB Networking section. You can configure your VNET or firewall rules as needed.
  2. Check if your organization allows your IP to be visible to Azure. In my case, I was able to connect only when I was not connected to organization VPN. "Some network environments may not report the actual public-facing IP address needed to access your server. Contact your network administrator if adding your IP address does not allow access to your server."

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.