Connecting to an Azure Database for PostgreSQL server with Azure Client Shell

In a previous post at https://jaimemontoya.com/blog/2023/12/17/11/41/, I explained the process I followed for provisioning Azure relational database services to create a PostgreSQL database resource.

Instead of downloading psql, I connected by using psql in Azure Cloud Shell within the Azure portal.

I started by creating a new Azure Database for PostgreSQL Flexible server with the following configurations:

New Azure Database for PostgreSQL Flexible server

I made a note of my server name, server admin login name, and password for my newly created server from the Overview section of my server. I clicked Connect to open Azure Cloud Shell in the portal:

Server name ad admin login

I selected a database to connect and clicked Yes to allow public access from Azure Services within Azure to my server:

Allow public access from Azure Services

I clicked Bash:

Select Bash from Azure Cloud Shell

I clicked Create storage:

Create storage

I connected to the server successfully with my credentials. Then I created a database called guest. After that, I switched connections to the newly created guest database. Finally, I typed \q, and then selected the Enter key to close psql:

Create new PostgreSQL database

The database that I created from Azure Cloud Shell appeared correctly from the graphical user interface:

PostgreSQL database from graphical user interface
Published: 6:15 AM GMT · Jan 11, 2024