Azure Synapse Analytics 中专用 SQL 池的源代码管理集成Source Control Integration for dedicated SQL pool in Azure Synapse Analytics

本教程概述了如何将 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 dedicated 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 one by selecting Manage Connection.

    管理连接Manage Connections

  3. 通过依次选择“管理连接”、“连接到项目”连接到你的项目 。Connect to your project by selecting Manage Connections, then Connect to a project.

    Connect1Connect1

  4. 找到你在步骤 1 中创建的项目,选择“连接”。Find the project you created in step one, select Connect.

    Connect2Connect2

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

    克隆存储库Clone repo

有关使用 Visual Studio 连接项目的详细信息,请参阅在团队资源管理器中连接到项目For more information about connecting projects using Visual Studio, see the Connect to projects in Team Explorer. 有关使用 Visual Studio 克隆存储库的指南,请查看克隆现有 Git 存储库一文。For guidance on cloning a repo using Visual Studio, review the Clone an exiting Git repo article.

创建并连接项目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 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 Repo。Verify 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 Repo。Commit 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 更新对目标专用 SQL 池的更改,以确保 Azure Repo 存储库和本地存储库中的对象定义反映专用 SQL 池。(Optional) Use Schema Compare and update the changes to your target dedicated SQL pool using SSDT to ensure the object definitions in your Azure Repo repository and local repository reflect your dedicated SQL pool.

后续步骤Next steps