0
0
Azurecloud~10 mins

Azure Database for PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an Azure Database for PostgreSQL server using Azure CLI.

Azure
az postgres server create --resource-group myResourceGroup --name mypgserver --location eastus --admin-user myadmin [1] --sku-name B_Gen4_1
Drag options to blanks, or click blank then click option'
A--admin-password MyPassword123
B--admin-password
C--adminpass
D--password-admin
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect option names like --password-admin or --adminpass.
Omitting the password value after the option.
2fill in blank
medium

Complete the code to configure the firewall rule to allow access from a specific IP address.

Azure
az postgres server firewall-rule create --resource-group myResourceGroup --server-name mypgserver --name AllowMyIP --start-ip-address [1] --end-ip-address [1]
Drag options to blanks, or click blank then click option'
A255.255.255.255
B0.0.0.0
Clocalhost
D192.168.1.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' which is not a valid IP address for firewall rules.
Using 0.0.0.0 or 255.255.255.255 which are not specific IPs.
3fill in blank
hard

Fix the error in the command to scale the Azure Database for PostgreSQL server to 4 vCores.

Azure
az postgres server update --resource-group myResourceGroup --name mypgserver --sku-name [1]
Drag options to blanks, or click blank then click option'
AGP_Gen5_4
BB_Gen5_2
CGP_Gen5_2
DB_Gen5_4
Attempts:
3 left
💡 Hint
Common Mistakes
Using a SKU with fewer vCores than required.
Using a SKU from a different tier unintentionally.
4fill in blank
hard

Fill both blanks to create a PostgreSQL database and assign it to the server.

Azure
az postgres db create --resource-group myResourceGroup --server-name mypgserver --name [1] --charset [2]
Drag options to blanks, or click blank then click option'
Amydatabase
Butf8
Clatin1
Dtestdb
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid charset like 'latin1' which is not recommended for PostgreSQL.
Confusing database name with server name.
5fill in blank
hard

Fill all three blanks to configure a connection string for the PostgreSQL server.

Azure
postgresql://[1]:[2]@[3].postgres.database.azure.com:5432/mydatabase?sslmode=require
Drag options to blanks, or click blank then click option'
Amyadmin
BMyPassword123
Cmypgserver
Dmydatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the database name in the server name blank.
Mixing up username and password positions.