Azure DevOps Services 版本控制Azure DevOps Services version control

Azure DevOps 是一系列服务,提供针对 DevOps 的五个核心实践的端到端解决方案:规划和跟踪、开发、生成和测试、交付以及监视和操作。Azure DevOps is a collection of services that provide an end-to-end solution for the five core practices of DevOps: planning and tracking, development, build and test, delivery, and monitoring and operations. 本文介绍如何将 Azure DevOps 设置为 Git 提供程序。This article describes how to set Azure DevOps as your Git provider.

备注

有关从 Visual Studio Team Services 到 Azure DevOps 的名称更改的信息,请参阅 现在 Azure DevOps Services Visual Studio Team ServicesFor information about the name change from Visual Studio Team Services to Azure DevOps, see Visual Studio Team Services is now Azure DevOps Services.

启用和禁用 Git 版本控制Enable and disable Git versioning

默认情况下启用版本控制。By default version control is enabled. 若要切换此设置,请参阅 在 Git 中管理对笔记本进行版本控制To toggle this setting, see Manage the ability to version notebooks in Git. 如果禁用了 Git 版本控制,则 " Git 集成 " 选项卡在 " 用户设置 " 屏幕中不可用。If Git versioning is disabled, the Git Integration tab is not available in the User Settings screen.

入门Get started

使用 Azure Active Directory (Azure AD) 进行身份验证时,将自动进行 Azure DevOps Services 身份验证。Authentication with Azure DevOps Services is done automatically when you authenticate using Azure Active Directory (Azure AD). Azure DevOps Services 组织必须链接到与 Databricks 相同的 Azure AD 租户。The Azure DevOps Services organization must be linked to the same Azure AD tenant as Databricks.

在 Azure Databricks 中,将 Git 提供程序设置为 "用户设置" 页上的 Azure DevOps Services:In Azure Databricks, set your Git provider to Azure DevOps Services on the User Settings page:

  1. 单击屏幕右上角的 "用户图标  帐户" 图标 ,然后选择 " 用户设置"。Click the User icon Account Icon at the top right of your screen and select User Settings.

    帐户设置Account settings

  2. 单击 " Git 集成 " 选项卡。Click the Git Integration tab.

  3. 将提供程序更改为 Azure DevOps Services。Change your provider to Azure DevOps Services.

    Azure DevOps Services GitHub 提供程序Azure DevOps Services GitHub provider

笔记本集成Notebook integration

笔记本与 Azure DevOps Services 的集成与 GitHub 的集成完全相同。Notebook integration with Azure DevOps Services is exactly like integration with GitHub. 若要详细了解如何使用 Git 处理笔记本,请参阅 使用笔记本修订版本See Work with notebook revisions to learn more about how to work with notebooks using Git.

提示

在 Git 首选项中,使用 URL 方案将 https://dev.azure.com/<org>/<project>/_git/<repo> Azure DevOps 和 Azure Databricks 链接到同一个 Azure AD 租户。In Git Preferences, use the URL scheme https://dev.azure.com/<org>/<project>/_git/<repo> to link Azure DevOps and Azure Databricks to the same Azure AD tenant.

Git 首选项

如果你的 Azure DevOps organzation 为 org.visualstudio.com ,请 dev.azure.com 在浏览器中打开并导航到你的存储库。If your Azure DevOps organzation is org.visualstudio.com, open dev.azure.com in your browser and navigate to your repository. 从浏览器复制 URL,并将该 URL 粘贴到 链接 字段中。Copy the URL from the browser and paste that URL in the Link field.

故障排除Troubleshooting

Databricks UI 中的 "保存" 按钮灰显。The Save button in the Databricks UI is grayed out.

Visual Studio Team Services 重命名为 Azure DevOps ServicesVisual Studio Team Services renamed to Azure DevOps Services. 格式的原始 Url https://<org>.visualstudio.com/<project>/_git/<repo> 在 Azure Databricks 笔记本中不起作用。Original URLs in the format https://<org>.visualstudio.com/<project>/_git/<repo> do not work in Azure Databricks notebooks.

组织管理员可以从 "组织设置" 页中自动更新 Azure DevOps Services 的 Url。An organization administrator can automatically update the URLs in Azure DevOps Services from the organization settings page.

或者,你可以手动创建 Azure Databricks 笔记本中用于与 Azure DevOps Services 同步的新 URL 格式。Alternately, you can manually create the new URL format used in Azure Databricks notebooks to sync with Azure DevOps Services. 在 Azure Databricks 笔记本中,在 "Git 首选项" 对话框的 " 链接 " 字段中输入新的 URL。In the Azure Databricks notebook, enter the new URL in the Link field in the Git Preferences dialog.

旧 URL 格式:Old URL format:

https://<org>.visualstudio.com/<project>/_git/<repo>

新 URL 格式:New URL format:

https://dev.azure.com/<org>/<project>/_git/<repo>