title | description | ms.service | ms.subservice | ms.topic | ms.author | author | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|
Configure parameters - Azure Database for PostgreSQL - Single Server |
This article describes how to configure Postgres parameters in Azure Database for PostgreSQL - Single Server using the Azure CLI. |
postgresql |
single-server |
how-to |
sunila |
sunilagarwal |
azurecli |
06/24/2022 |
devx-track-azurecli |
Customize server configuration parameters for Azure Database for PostgreSQL - Single Server using Azure CLI
[!INCLUDE applies-to-postgresql-single-server]
[!INCLUDE azure-database-for-postgresql-single-server-deprecation]
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 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 mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration list --resource-group myresourcegroup --server mydemoserver
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 mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration show --name log_min_messages --resource-group myresourcegroup --server mydemoserver
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 mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres server configuration set --name log_min_messages --resource-group myresourcegroup --server mydemoserver --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 mydemoserver
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.
- Learn how to restart a server
- To configure and access server logs, see Server Logs in Azure Database for PostgreSQL