Azure 管道数据同步

Azure Pipeline Data Sync

我们在 Azure SQL 的开发和测试环境中有一些数据库(10 个数据库)。我们希望能够使用 azure pipeline.

在环境之间同步数据

模式更改会自动发生 entity framework 迁移,这很好。

为了同步数据,我们在 visual studio 中创建了一个数据比较,我们用它来按需同步数据。现在我们想自动化这个过程(同步数据)。

我们是否可以将现有任务添加到管道中以 运行 此数据比较和后续同步?

你可以用 SQL Data Sync for Azure 来做到这一点。

它的作用:

SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi-directionally across multiple databases, both on-premises and in the cloud.

如果您需要:

  • 创建同步组 - 在您的 prod 数据库上
  • 使用同步成员 - 在这里您将使用您的测试数据库
  • 比配置组同步

您可以 select 有什么特别需要同步的:

然后您可以从调用

的 azure 管道中触发它
Start-AzSqlSyncGroupSync -ResourceGroupName $resourceGroupName -ServerName $serverName -DatabaseName $databaseName -SyncGroupName $syncGroupName

Azure PowerShell task. If you define cron schedule 开始,您将获得最新的数据。