Complete the code to create an Azure Database for PostgreSQL server using Azure CLI.
az postgres server create --resource-group myResourceGroup --name mypgserver --location eastus --admin-user myadmin [1] --sku-name B_Gen4_1The --admin-password option is required to set the administrator password when creating the PostgreSQL server.
Complete the code to configure the firewall rule to allow access from a specific IP address.
az postgres server firewall-rule create --resource-group myResourceGroup --server-name mypgserver --name AllowMyIP --start-ip-address [1] --end-ip-address [1]
The start-ip-address and end-ip-address define the IP range allowed. To allow a single IP, both should be the same IP address.
Fix the error in the command to scale the Azure Database for PostgreSQL server to 4 vCores.
az postgres server update --resource-group myResourceGroup --name mypgserver --sku-name [1]The GP_Gen5_4 SKU name represents 4 vCores in the General Purpose tier. Using this SKU scales the server to 4 vCores.
Fill both blanks to create a PostgreSQL database and assign it to the server.
az postgres db create --resource-group myResourceGroup --server-name mypgserver --name [1] --charset [2]
The --name option specifies the database name, and --charset sets the character encoding, commonly 'utf8' for PostgreSQL databases.
Fill all three blanks to configure a connection string for the PostgreSQL server.
postgresql://[1]:[2]@[3].postgres.database.azure.com:5432/mydatabase?sslmode=require
The connection string format requires the username, password, and server name. Here, myadmin is the username, MyPassword123 is the password, and mypgserver is the server name.