< Back

New-AzureRmSqlSyncGroup

Tue Jan 29, 2019 10:09 pm

NAME New-AzureRmSqlSyncGroup



SYNOPSIS

Creates an Azure SQL Database Sync Group.





SYNTAX

New-AzureRmSqlSyncGroup [-ResourceGroupName] <String> [-ServerName] <String> [-DatabaseName] <String> [-Name] <String> [-ConflictResolutionPolicy

{HubWin | MemberWin}] [-DatabaseCredential <PSCredential>] [-DefaultProfile <IAzureContextContainer>] [-IntervalInSeconds <Int32>] [-SchemaFile

<String>] -SyncDatabaseName <String> -SyncDatabaseResourceGroupName <String> -SyncDatabaseServerName <String> [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The New-AzureRmSqlSyncGroup cmdlet creates an Azure SQL Database Sync Group.





PARAMETERS

-ConflictResolutionPolicy <String>

The policy of resolving confliction between hub and member database in the sync group.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DatabaseCredential <PSCredential>

The SQL authentication credential of the hub database.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DatabaseName <String>

The name of the Azure SQL Database.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IntervalInSeconds <Int32>

The frequency (in seconds) of doing data synchronization. Default is -1, which means the auto synchronization is not enabled.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

The sync group name.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the resource group.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SchemaFile <String>

The path of the schema file.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ServerName <String>

The name of the Azure SQL Server.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SyncDatabaseName <String>

The database used to store sync related metadata.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SyncDatabaseResourceGroupName <String>

The resource group the sync metadata database belongs to.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SyncDatabaseServerName <String>

The server on which the sync metadata database is hosted.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Sql.DataSync.Model.AzureSqlSyncGroupModel







NOTES









Example 1: Create a sync group for an Azure SQL Database.



PS C:\\> $credential = Get-Credential

PS C:\\> New-AzureRmSqlSyncGroup -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -Name "SyncGroup01"

-ConflictResolutionPolicy "HubWin"

-DatabaseCredential $credential -IntervalInSeconds 100 -SyncDatabaseServerName "syncDatabaseServer01" -SyncDatabaseName "syncDatabaseName01"

-SyncDatabaseResourceGroupName "syncDatabaseResourceGroup01" -Schema ".\\schema.json" | Format-List

ResourceId :

/subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup01}/servers/{Server01}/databases/{Database01}/syncGroups/{SyncGroup01}

ResourceGroupName : ResourceGroup01

ServerName : Server01

DatabaseName : Database01

SyncGroupName : SyncGroup01

SyncDatabaseId :

subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup01}/servers/{syncDatabaseServer01}/databases/{syncDatabaseName01}

IntervalInSeconds : 100

ConflictResolutionPolicy: : HubWin

HubDatabaseUserName : myAccount

HubDatabasePassword :

SyncState : NotReady

LastSyncTime : 1/1/0001 12:00:00 AM

Schema :



This command creates a sync group for an Azure SQL Database. "schema.json" is a file in the local disk. It contains the shema payload in json

format. An example of the schema json is: {"Tables": [{"Columns": [{"QuotedName": "b3ee3a7f-7614-4644-ad07-afa832620b4bManualTestsm4column1"},

{"QuotedName": "b3ee3a7f-7614-4644-ad07-afa832620b4bManualTestsm4column2"}], "QuotedName": "MayQuotedTable1"}, {"Columns": [{"QuotedName":

"b3ee3a7f-7614-4644-ad07-afa832620b4bManualTestsm4column1"}, {"QuotedName": "b3ee3a7f-7614-4644-ad07-afa832620b4bManualTestsm4column2"}],

"QuotedName": "MayQuotedTable2"}], "MasterSyncMemberName": null }







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... lsyncgroup

Set-AzureRmSqlSyncGroup

Remove-AzureRmSqlSyncGroup

Get-AzureRmSqlSyncGroup