Edit

Tutorial: Run a PostgreSQL zone-down failover Scenario

In this tutorial, you create a Chaos Studio Workspace, configure it to target your Azure Database for PostgreSQL resources, and run a zone-down failover Scenario. At the end, you review the Scenario report to confirm which actions ran and their outcomes, then validate recovery using your own monitoring and application health checks.

Prerequisites

Important

The resource group you target must contain only HA-enabled PostgreSQL instances. Remove any read replicas from the resource group before you run this Scenario. Non-HA instances and read replicas cause the failover action to fail.

Create a Workspace

  1. In the Azure portal, search for Chaos Studio and select it.

    Screenshot that shows searching for Chaos Studio in the Azure portal.

  2. Select Create new workspace.

    Screenshot that shows the Create new workspace button on the Chaos Studio home page.

  3. On the Basics tab, fill in your Subscription, Resource group, Workspace name, and Region. The Workspace can operate on resources in any region, so choose any supported region. Select Next: Scope.

    Screenshot that shows the Basics tab of the Create a Workspace form.

Configure scope

  1. For Scope type, select Subscription or Resource group. This scope type is recommended for PostgreSQL failover Scenarios because it discovers all HA instances in the resource group automatically.

  2. Select your subscription and resource group, then select Apply.

    Screenshot that shows the Scope configuration page with a resource group selected.

Configure permissions

  1. For Managed identity, select User assigned. A user-assigned identity is recommended for PostgreSQL failover Scenarios because it persists independently of the Workspace.

  2. Grant the required permissions to the identity. You need at least Reader or Contributor access on the managed identity to add it here.

  3. Select Add to assign the identity.

    Screenshot that shows the managed identity and required permissions configuration.

Review and create

  1. Select Review + Create.

  2. Review your configuration, then select Create.

    Screenshot that shows the Review + Create page for a new Workspace.

Verify the Workspace

  1. After deployment completes, navigate to the Workspace's Overview page.

  2. Confirm the Scope shows your resource group and the Managed identity is assigned.

    Screenshot that shows the Workspace Overview page with scope and identity verified.

Browse and configure a Scenario

  1. Select the Scenarios tab. Chaos Studio discovers the resources in your scope and recommends applicable Scenarios.

  2. Find the Compute Zone Down + PostgreSQL Failover Scenario and select Configure.

    Screenshot that shows the Scenarios page with the PostgreSQL zone-down failover Scenario.

  3. Enter a Name and Duration for the failover test, then select Save Configuration.

    Screenshot that shows the Scenario configuration form with name and duration fields.

Run the Scenario

  1. Select the My Library tab to view your saved Scenarios.

  2. Select Run on the PostgreSQL failover Scenario.

    Screenshot that shows the My Library page with the Run button for the Scenario.

    Important

    After you select Run, wait for the Scenario run page to appear. You might need to refresh the portal. Don't select Run again — the Scenario is already queued and a duplicate run could affect your resources.

  3. Monitor the run progress on the Scenario run page.

    Screenshot that shows the Scenario in a running state.

Review the Scenario report

  1. When the Scenario status shows Succeeded, select Generate report.

    Screenshot that shows the Scenario in a succeeded state.

  2. Review the report to see which actions ran, their durations, and whether each action succeeded.

    Screenshot that shows the Scenario report with action details.

    For more information about what each section of the report means, see Scenario reports.

Clean up resources

If you created the Workspace only for this tutorial, delete it by navigating to the Workspace resource and selecting Delete. Deleting the Workspace doesn't affect your PostgreSQL instances.

Next steps