Manage high availability in Azure Database for PostgreSQL - Flexible Server with Azure CLI

APPLIES TO: Azure Database for PostgreSQL - Flexible Server

The article describes how you can enable or disable high availability configuration at the time of server creation in Azure Database for PostgreSQL flexible server. You can disable high availability after server creation too.

High availability feature provisions physically separate primary and standby replica in different zones. For more information, see high availability concepts documentation. Enabling or disabling high availability doesn't change your other settings including VNET configuration, firewall settings, and backup retention. Disabling of high availability doesn't impact your application connectivity and operations.

Important

For the list of regions that support Zone redundant high availability, please review the supported regions here.

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin.

  • Install or upgrade Azure CLI to the latest version. See Install Azure CLI.

  • Log in to Azure account using az login command. The id property, which refers to Subscription ID for your Azure account.

    az login
    
  • If you have multiple subscriptions, choose the appropriate subscription in which you want to create the server using the az account set command. `

    az account set --subscription <subscription id>
    

Enable high availability during server creation

You can only create server using General purpose or Memory optimized pricing tiers with high availability. You can enable high availability for a server only during create time.

Usage:

az postgres flexible-server create [--high-availability {Disabled, Enabled}]
                                [--resource-group]
                                [--name]

Example:

az postgres flexible-server create --name myservername --sku-name Standard-D2ds_v4 --resource-group myresourcegroup --high-availability Enabled

Disable high availability

You can disable high availability by using the az postgres flexible-server update command. Disabling high availability is only supported if the server is configured with high availability.

az postgres flexible-server update [--high-availability {Disabled, Enabled}]
                                [--resource-group]
                                [--name]

Example:

az postgres flexible-server update --resource-group myresourcegroup --name myservername --high-availability Disabled

Next steps