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
| Parameter | Type | Description |
|---|---|---|
| -Name | String | Identifier of the failover group. |
| -ResourceGroupName | String | Name of the Azure resource group. |
| -ServerName | String | Name of the primary MariaDB server. |
| -PartnerServers | String[] | List of secondary servers to include in the group. |
| -FailoverPolicy | String | Policy for automatic failover. Valid values: Automatic, Manual. |
| -GracePeriodWithDataLossMinutes | Int32 | Grace period (in minutes) before a forced failover that might cause data loss. |
| -Force | Switch | Suppress confirmation prompts when removing a failover group. |
| -WhatIf | Switch | Shows what would happen if the command runs. |
| -Confirm | Switch | Prompts 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.