1

I need a PowerShell script to sync between an Azure SQL Database and a SQL Server on-premises database. I have gone through this link (https://learn.microsoft.com/en-us/azure/azure-sql/database/scripts/sql-data-sync-sync-data-between-azure-onprem) and I was able to generate Sync Agent, Sync Group, Sync member. Now I'm getting an error like below: enter image description here

the powershell code is as below

using namespace Microsoft.Azure.Commands.Sql.DataSync.Model
using namespace System.Collections.Generic
    Write-Host "Adding tables and columns to the sync schema..."
    $databaseSchema = Get-AzSqlSyncSchema -ResourceGroupName "myresource" -ServerName "myservername" `
        -DatabaseName "mydatabase" -SyncGroupName "TestSync" `
    $databaseSchema | ConvertTo-Json -depth 5 -Compress | Out-File "syncSchema.json"
    $newSchema = [AzureSqlSyncGroupModel]::new() 
    $newSchema.Tables = [List[AzureSqlSyncGroupSchemaTableModel]]::new();
Sanal.A
  • 21
  • 4
  • [Here](https://stackoverflow.com/questions/62069898/sync-data-between-azure-database-and-local-database-using-cloud-power-shell/63390766#63390766) is a similar answer from me. – KrishnaG Aug 15 '20 at 06:24

0 Answers0