New-​Azure​Rm​Sql​Database​Failover​Group

This command is executed in the context of the primary server. It creates the new Azure SQL Failover Group on the server.

Syntax

New-AzureRmSqlDatabaseFailoverGroup
   [-AllowReadOnlyFailoverToPrimary <AllowReadOnlyFailoverToPrimary>]
   -FailoverGroupName <String>
   [-FailoverPolicy <FailoverPolicy>]
   [-GracePeriodWithDataLossHours <Int32>]
   [-PartnerResourceGroupName <String>]
   -PartnerServerName <String>
   -ResourceGroupName <String>
   -ServerName <String>
   [-Tags <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Cmdlet that creates the new Azure SQL Failover Group on the server.

Examples

Example 1

PS C:\> C:\> $ag = New-AzureRMSqlDatabaseFailoverGroup -ResourceGroupName "myrg" -ServerName "myserver" -PartnerServerName "mydrserver" -FailoverGroupName “MyFG” -FailoverPolicy "Automatic" -AllowReadOnlyFailoverToPrimary "Enabled" -GracePeriodWithDataLossHours 1

Required Parameters

-FailoverGroupName

The name of the Azure SQL FailoverGroup to create.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartnerServerName

The partner server name for Azure SQL Database Failover Group.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServerName

The name of the Azure SQL Server the Failover Group is in.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AllowReadOnlyFailoverToPrimary

The failover policy for read only endpoint of the failover group.

Type:AllowReadOnlyFailoverToPrimary
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FailoverPolicy

The failover policy without data loss for the failover group.

Type:FailoverPolicy
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-GracePeriodWithDataLossHours

The grace period for failover with data loss of the failover group.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartnerResourceGroupName

The partner resource group name for Azure SQL Database Failover Group.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Tags

The tag to associate with the Azure Sql Failover Group

Type:Hashtable
Aliases:Tag
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

Outputs

System.Object