New-AzureRmSqlSyncAgent

Creates an Azure SQL Sync Agent.

Important

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

New-AzureRmSqlSyncAgent
   [-Name] <String>
   -SyncDatabaseName <String>
   [-SyncDatabaseServerName <String>]
   [-SyncDatabaseResourceGroupName <String>]
   [-ServerName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmSqlSyncAgent
   [-Name] <String>
   -SyncDatabaseResourceID <String>
   [-ServerName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmSqlSyncAgent cmdlet creates an Azure SQL Sync Agent.

Examples

Example 1: Create a sync agent for an Azure SQL server.

PS C:\> New-AzureRmSqlSyncAgent -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -Name "SyncAgent01" -SyncDatabaseServerName "syncDatabaseServer01" 
-SyncDatabaseName "syncDatabaseName01" -SyncDatabaseResourceGroupName "syncDatabaseResourceGroup01" | Format-List
ResourceId                  : subscriptions/{subscriptionId}/resourceGroups/{ResourceGroup01}/servers/{Server01}/syncAgents/{SyncAgent01}
ResourceGroupName           : ResourceGroup01
ServerName                  : Server01
DatabaseName                : Database01
SyncAgentName               : SyncAgent01
SyncDatabaseId              : subscriptions/{subscriptionId}/resourceGroups/{syncDatabaseResourceGroup01}/servers/{syncDatabaseServer01}/databases/{syncDatabaseName01}
LastAliveTime:              : 
Version                     : 4.2.0.0
IsUpToDate                  : True
ExpiryTime                  : 12/31/9999 11:59:59 PM
State                       : NeverConnected

This command creates a sync agent for an Azure SQL server.

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

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

The sync agent name.

Type:String
Aliases:SyncAgentName
Position:2
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ServerName

The name of the Azure SQL Server the sync agent is in.

Type:String
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SyncDatabaseName

The database used to store sync related metadata.

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

The resource group the sync metadata database belongs to.

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

The resource ID of the sync metadata database.

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

The server on which the sync metadata database is hosted.

Type:String
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

String

Outputs

AzureSqlSyncAgentModel