Hosting pgAdmin 4 on Azure Web App for Containers

Anmol Tandon
3 min readFeb 18, 2021

Azure Database for PostgreSQL is a relational database service based on the open-source Postgres database engine. It’s a fully managed database-as-a-service that can handle mission-critical workloads with predictable performance, security, high availability, and dynamic scalability.

There has been a huge demand of workloads that use PostgreSQL as their preferred database. And a problem that people usually face is in regards to managing the database and its related operations. pgAdmin is one such popular and feature rich Open Source administration and development platform for PostgreSQL. It helps you with managing as well as connecting to the database.

You can either install in on your local system, or host it on any of the cloud providers. The former is for the people that have administrative rights on the system. But there are many scenarios where the developer might not have administrative rights and in these cases the latter option might come in handy.

Here, using Azure Web App for Containers, we can host the pgAdmin and allow users to connect to the database from a single point of entry. This would eventually reduce the whitelisting of firewall IP address requests coming for each database. Users would use a single address to connect to the database and the personal public IP whitelisting will not be required.

To host pgAdmin on web app, create a web app for containers in the portal. Enter the relevant subscription and resource group details. Give the web app a name and choose the publish method as “Docker Container”.

Also, create the app service plan and choose the relevant pricing tier. Since it was not a demanding workload, I selected Basic B1.

Now click on “Next” and enter the following details:

Options — Single Container

Image Source — Docker Hub

Access Type — Public

Image and Tag — dpage/pgadmin4:latest

And create the web app.

Next we would need to enter username and password that will be used to login to the pgAdmin and we can do that using app settings in Configuration.

Once you click on “Save” the web app will pull the image and load it. Wait for a couple of minutes and go to the web app url. You will see the pgAdmin4 landing page. Enter the credentials set in the last step and login.

This basically pulls the pgAdmin docker image and loads it on the web app for containers in Azure. To get the updates you can also enable Continuous Integration and as soon as there is a push to pgAdmin image with the latest tag, the web app will automatically pull it from Docker Hub.

--

--