SQL 池的源代码管理集成Source Control Integration for SQL pool

本教程概述了如何将 SQL Server Data tools (SSDT) 数据库项目与源代码管理集成。This tutorial outlines how to integrate your SQL Server Data tools (SSDT) database project with source control. 源代码管理集成是使用 Azure Synapse Analytics 中的 SQL 池资源构建持续集成和部署管道的第一步。Source control integration is the first step in building your continuous integration and deployment pipeline with the SQL pool resource in Azure Synapse Analytics.

开始之前Before you begin

设置并连接到 Azure DevOpsSet up and connect to Azure DevOps

  1. 在 Azure DevOps 组织中,创建一个通过 Azure Repo 存储库托管 SSDT 数据库项目的项目In your Azure DevOps Organization, create a project that will host your SSDT database project via an Azure Repo repository

    创建项目Create Project

  2. 打开 Visual Studio 并通过选择“管理连接”连接到步骤 1 中的 Azure DevOps 组织和项目Open Visual Studio and connect to your Azure DevOps organization and project from step 1 by selecting "Manage Connections"

    管理连接Manage Connections

    “连接”Connect

  3. 将项目中的 Azure Repo 存储库克隆到本地计算机Clone your Azure Repo repository from your project to your local machine

    克隆存储库Clone repo

创建并连接项目Create and connect your project

  1. 在 Visual Studio 中,使用本地克隆存储库中的目录和本地 Git 存储库创建新的 SQL Server 数据库项目In Visual Studio, create a new SQL Server Database Project with both a directory and local Git repository in your local cloned repository

    创建新项目Create new project

  2. 右键单击空的 sqlproject 并将数据仓库导入数据库项目Right-click on your empty sqlproject and import your data warehouse into the database project

    导入项目Import Project

  3. 在 Visual Studio 的团队资源管理器中,将所有更改提交到本地 Git 存储库In team explorer in Visual Studio, commit your all changes to your local Git repository

    提交Commit

  4. 既然已在克隆的存储库中本地提交了更改,请将更改同步并推送到 Azure DevOps 项目中的 Azure Repo 存储库。Now that you have the changes committed locally in the cloned repository, sync and push your changes to your Azure Repo repository in your Azure DevOps project.

    同步和推送 - 暂存Sync and Push - staging

    同步和推送Sync and Push

验证Validation

  1. 通过从 Visual Studio SQL Server Data Tools (SSDT) 更新数据库项目中的表列,验证是否已将更改推送到 Azure RepoVerify changes have been pushed to your Azure Repo by updating a table column in your database project from Visual Studio SQL Server Data Tools (SSDT)

    验证更新列Validate update column

  2. 提交更改并将更改从本地存储库推送到 Azure RepoCommit and push the change from your local repository to your Azure Repo

    推送更改Push changes

  3. 验证是否已将更改推送到 Azure Repo 存储库Verify the change has been pushed in your Azure Repo repository

    验证Verify

  4. 可选)使用“架构比较”并使用 SSDT 更新对目标数据仓库的更改,以确保 Azure Repo 存储库和本地存储库中的对象定义反映数据仓库(Optional) Use Schema Compare and update the changes to your target data warehouse using SSDT to ensure the object definitions in your Azure Repo repository and local repository reflect your data warehouse

后续步骤Next steps