Add-​Azure​Rm​Sql​Database​To​Failover​Group

Cmdlet that adds databases into the Azure SQL Failover Group

Syntax

Add-AzureRmSqlDatabaseToFailoverGroup
   -Databases <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel]>
   -FailoverGroupName <String>
   -ResourceGroupName <String>
   -ServerName <String>
   [-Tags <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Cmdlet to add Azure Sql Databases into a Failover Group. Database input parameters should be a Azure Sql Database Model object, which could be obtained either through pipelining or storing in Powershell environment variables with the Get_AzureRmSqlDatabase Cmdelet.

Examples

Example 1

PS C:\> Add-AzureRmSqlDatabaseToFailoverGroup -FailoverGroupName myFg-ResourceGroupName myRg -ServerName mysvr

Example 2

Using Pipe Line to pipe in the database objects

PS C:\> Get-AzureRmSqlDatabase -ServerName testsvr -ResourceGroupName rg2 | Add-AzureRmSqlDatabaseToFailoverGroup -FailoverGroupName myFg-ResourceGroupName myRg -ServerName mysvr

Required Parameters

-Databases

The Azure SQL Databases to be added to the secondary server.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-FailoverGroupName

The name of the Azure SQL Failover Group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
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

-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
-Tags

The tags to associate with the Azure Sql Elastic Pool

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

System.Collections.Generic.List`1[[Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel, Microsoft.Azure.Commands.Sql, Version=2.5.0.0, Culture=neutral, PublicKeyToken=null]]

Outputs

System.Object