title | description | services | author | ms.author | manager | editor | ms.service | ms.devlang | ms.topic | ms.date |
---|---|---|---|---|---|---|---|---|---|---|
Configure the service parameters in Azure Database for PostgreSQL | Microsoft Docs |
This article describes how to configure the service parameters in Azure Database for PostgreSQL using the Azure CLI command line. |
postgresql |
SaloniSonpal |
salonis |
jhubbard |
jasonwhowell |
postgresql |
azure-cli |
article |
10/05/2017 |
You can list, show, and update configuration parameters for an Azure PostgreSQL server using the Command Line Interface (Azure CLI). A subset of engine configurations is exposed at server-level and can be modified.
To step through this how-to guide, you need:
- Create an Azure Database for PostgreSQL server and database by following Create an Azure Database for PostgreSQL
- Install Azure CLI 2.0 command-line interface on your machine or use the Azure Cloud Shell in the Azure portal using your browser.
To list all modifiable parameters in a server and their values, run the az postgres server configuration list command.
You can list the server configuration parameters for the server mypgserver-20170401.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration list --resource-group myresourcegroup --server mypgserver-20170401
To show details about a particular configuration parameter for a server, run the az postgres server configuration show command.
This example shows details of the log_min_messages server configuration parameter for server mypgserver-20170401.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration show --name log_min_messages --resource-group myresourcegroup --server mypgserver-20170401
You can also modify the value of a certain server configuration parameter, which updates the underlying configuration value for the PostgreSQL server engine. To update the configuration, use the az postgres server configuration set command.
To update the log_min_messages server configuration parameter of server mypgserver-20170401.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration set --name log_min_messages --resource-group myresourcegroup --server mypgserver-20170401 --value INFO
If you want to reset the value of a configuration parameter, you simply choose to leave out the optional --value
parameter, and the service applies the default value. In above example, it would look like:
az postgres server configuration set --name log_min_messages --resource-group myresourcegroup --server mypgserver-20170401
This command resets the log_min_messages configuration to the default value WARNING. For more information on server configuration and permissible values, see PostgreSQL documentation on Server Configuration.
- To configure and access server logs, see Server Logs in Azure Database for PostgreSQL