Follow the steps below to create a database for PostgreSQL in Azure Portal.
Step 1
Sign in to the Azure Portal.
Step 2
Select the "New+" button on the left side corner of the Azure portal, then choose Databases >> Azure database for PostgreSQL (Preview).
Step 3
In the PostgreSQL Server creation blade, enter the unique server name, then choose the subscription you have and create a new resource group. You must enter the server admin name and also give the password for the PostgreSQL Server.
Choose the location nearest to our location. For the version, choose the PostgreSQL version you want and also choose the desired pricing tier for our server and then press OK and click CREATE to create the PostgreSQL server.
Step 4
After successful deployment, our PostgreSQL Server is shown in the overview tab.
Step 5
Then, we want to configure the firewall to connect to our client PC. By default, it rejects the connection to the server and the database. Click connection security and then click "Add My IP" to add our IP to PostgreSQL Server. Click the save button and then our IP is shown under the Firewall rules.
Step 6
In the connection string tab, you will see the various connection strings to connect the created PostgreSQL Server and the database to the application you want.