Azure PowerShell

AzMariaDbFailoverGroup

The AzMariaDbFailoverGroup cmdlet manages failover groups for Azure Database for MariaDB servers. Use it to create, update, retrieve, or remove failover groups, enabling high‑availability and geo‑replication scenarios.

Syntax

New-AzMariaDbFailoverGroup
    -Name <String>
    -ResourceGroupName <String>
    -ServerName <String>
    -PartnerServers <String[]>
    [-FailoverPolicy <String>]
    [-GracePeriodWithDataLossMinutes <Int32>]
    []

Get-AzMariaDbFailoverGroup
    [-Name <String>]
    [-ResourceGroupName <String>]
    [-ServerName <String>]
    []

Set-AzMariaDbFailoverGroup
    -Name <String>
    -ResourceGroupName <String>
    -ServerName <String>
    [-FailoverPolicy <String>]
    [-GracePeriodWithDataLossMinutes <Int32>]
    []

Remove-AzMariaDbFailoverGroup
    -Name <String>
    -ResourceGroupName <String>
    -ServerName <String>
    [-Force]
    []
        

Parameters

ParameterTypeDescription
-NameStringIdentifier of the failover group.
-ResourceGroupNameStringName of the Azure resource group.
-ServerNameStringName of the primary MariaDB server.
-PartnerServersString[]List of secondary servers to include in the group.
-FailoverPolicyStringPolicy for automatic failover. Valid values: Automatic, Manual.
-GracePeriodWithDataLossMinutesInt32Grace period (in minutes) before a forced failover that might cause data loss.
-ForceSwitchSuppress confirmation prompts when removing a failover group.
-WhatIfSwitchShows what would happen if the command runs.
-ConfirmSwitchPrompts for confirmation before executing the command.

Examples

Example 1: Create a new failover group

New-AzMariaDbFailoverGroup `
    -Name "myFailoverGroup" `
    -ResourceGroupName "RG-Prod" `
    -ServerName "myPrimaryServer" `
    -PartnerServers @("mySecondaryServer1","mySecondaryServer2") `
    -FailoverPolicy "Automatic" `
    -GracePeriodWithDataLossMinutes 60

Creates a failover group named myFailoverGroup with automatic failover and a one‑hour grace period.

Example 2: Retrieve details of a failover group

Get-AzMariaDbFailoverGroup `
    -ResourceGroupName "RG-Prod" `
    -ServerName "myPrimaryServer" `
    -Name "myFailoverGroup"

Displays the configuration and status of the specified failover group.

Example 3: Update the failover policy to manual

Set-AzMariaDbFailoverGroup `
    -ResourceGroupName "RG-Prod" `
    -ServerName "myPrimaryServer" `
    -Name "myFailoverGroup" `
    -FailoverPolicy "Manual"

Switches the failover policy to manual, requiring explicit failover commands.

Example 4: Remove a failover group

Remove-AzMariaDbFailoverGroup `
    -ResourceGroupName "RG-Prod" `
    -ServerName "myPrimaryServer" `
    -Name "myFailoverGroup" `
    -Force

Deletes the failover group without prompting for confirmation.

Related Links