如何修复数据工厂 v2 adf_publish 分支与 Azure Devops 中的主分支不同步

How to fix the data factory v2 adf_publish branch being out of sync with the master branch in azure devops

最近我 运行 遇到无法在与 azure devops/git 集成的 azure 数据工厂中发布的问题。发生这种情况是因为我们尝试使用 powershell 基于 json 模板自动创建管道。当使用 Set-AzDataFactoryV2Pipeline 在数据工厂中完成此操作时,您可以绕过 azure devops 集成,管道会立即发布,无需任何提交或拉取请求。下面是错误信息

发布错误

发布 b运行ch 与协作 b运行ch 不同步。这可能是由于在 Git 模式之外发布。要从此状态恢复,请参阅我们的 Git 故障排除指南

MS GIT 故障排除指南提出了一些核心措施来解决此不同步问题(我认为是通过删除并重新创建存储库)。在这种情况下,有一种更简单、更简单的方法来解决这个问题。

您只需要:

  • 从数据工厂中的 master 分支创建一个新分支
  • 创建您通过 Set-AzDataFactoryV2Pipeline 创建的相同管道
  • 创建拉取请求并将其合并到 master

瞧,希望您能够再次发布,因为它现在将考虑分支再次同步

Microsoft 现在提供解决此问题的指南:

发件人:https://docs.microsoft.com/en-us/azure/data-factory/source-control#stale-publish-branch

Stale publish branch

If the publish branch is out of sync with the master branch and contains out-of-date resources despite a recent publish, try following these steps:

  • Remove your current Git repository
  • Reconfigure Git with the same settings, but make sure Import existing Data Factory resources to repository is selected and choose New branch
  • Create a pull request to merge the changes to the collaboration branch

从数据工厂中删除您的 git 存储库并创建一个具有完全相同设置的新存储库。 转到 azure devops 并创建一个新的拉取请求以将新分支合并到 master。

Link: https://www.datastackpros.com/2020/05/how-to-fix-data-factory-adfpublish.html