Manage zone redundant high availability in Azure Database for PostgreSQL Flexible Server with Azure CLI
The article describes how you can enable or disable zone redundant high availability configuration at the time of server creation in your flexible server. You can disable zone redundant high availability after server creation too. Enabling zone redundant high availability after server creation is not supported.
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 does not change your other settings including VNET configuration, firewall settings, and backup retention. Disabling of high availability does not 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.
Login to Azure account using az login command. Note the id property, which refers to Subscription ID for your Azure account.
az loginIf you have multiple subscriptions, choose the appropriate subscription in which you want to create the server using the
az account setcommand. `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. Note that 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
- Learn about business continuity
- Learn about zone redundant high availability