Примечание
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
This article shows how to set up Databricks Git folders for version control. After you set up Git folders in your Databricks workspace, you can perform common Git operations such as clone, checkout, commit, push, pull, and branch management from the Databricks UI. You can also see diffs for your changes as you develop in Databricks.
Configure user settings
Databricks Git folders uses a personal access token (PAT) or an equivalent OAuth credential to authenticate with your Git provider to perform operations such as clone, push, pull etc. To use Git folders, you must first configure your Git credential in Databricks. См. статью Настройка учетных данных Git и & подключение удаленного репозитория к Azure Databricks.
You can clone public remote repositories without Git credentials. To modify a public remote repository or to clone or modify a private remote repository, you must have a Git credential with Write (or greater) permissions for the remote repository.
Git folders are enabled by default. For more details on enabling or disabling Git folder support, see Enable or disable the Databricks Git folder feature.
Добавление или изменение учетных данных Git в Databricks
Important
Databricks Git folders support just one Git credential per user, per workspace.
Выберите стрелку вниз рядом с именем учетной записи в правом верхнем углу экрана, а затем выберите Настройки.
Select the Linked accounts tab.
Если вы впервые добавляете учетные данные, следуйте инструкциям на экране.
Если вы ранее ввели учетные данные, щелкните Config>Изменить и перейдите к следующему шагу.
В раскрывающемся списке поставщика Git выберите имя поставщика.
If prompted, enter your Git user name or email.
If prompted, in the Token field, add a personal access token (PAT) or other credentials from your Git provider. For details, see Configure Git credentials & connect a remote repo to Azure Databricks
Important
Databricks рекомендует задать дату окончания срока действия для всех личных маркеров доступа.
For Azure DevOps, if you do not enter a token or app password, Git integration uses your Microsoft Entra ID token by default. If you enter an Azure DevOps personal access token, Git integration uses it instead. See Connect to an Azure DevOps repo using a token.
Note
После обновления пароля Azure повторно выполните проверку подлинности с помощью Azure Databricks, если вам нужна новая проверка подлинности, чтобы она сработала сразу. If you do not re-authenticate, the Azure DevOps connection may not be validated for up to 24 hrs.
If your organization has SAML SSO enabled in GitHub, authorize your personal access token for SSO.
Enter your username in the Git provider username field.
Click Save.
You can also save a Git PAT token and username to Azure Databricks using the Databricks Repos API.
If you are unable to clone the repo and you’re using Azure DevOps with Microsoft Entra ID authentication, see Issue with a conditional access policy (CAP) for Microsoft Entra ID.
Network connectivity between Databricks Git folders and a Git provider
Git folders requires network connectivity to your Git provider to function. Ordinarily, this is over the internet and works without further configuration. Однако возможно, вы настроили дополнительные ограничения для поставщика Git для управления доступом. For example, you might have an IP allow list in place, or you might host your own on-premises Git server using services like GitHub Enterprise (GHE), Bitbucket Server (BBS), or Gitlab Self-managed. Depending on your network hosting and configuration, your Git server might not be accessible via the internet.
Note
- If your Git server is internet-accessible but has an IP allowlist in place, such as GitHub allow lists, you must add Azure Databricks control plane NAT IPs to the Git server’s IP allowlist. See Azure Databricks regions for a list of control plane NAT IP addresses by region. Use the IP for the region that your Azure Databricks workspace is in.
- Если вы размещаете сервер Git в частном порядке, ознакомьтесь с разделом «Настройка частного подключения Git для папок Azure Databricks Git (Repos)» или обратитесь к команде вашей учетной записи Azure Databricks для получения инструкций по подключению.
Security features in Git folders
Databricks Git folders have many security features. The following sections walk you through their setup and use:
- Использование зашифрованных учетных данных Git
- An allowlist
- Workspace access control
- Audit logging
- Secrets detection
Используйте свой собственный ключ: зашифруйте учетные данные Git
You can use Azure Key Vault to encrypt a Git personal access token (PAT) or other Git credential. Using a key from an encryption service is referred to as a customer-managed key (CMK) or bring your own key (BYOK).
For more information, see Customer-managed keys for encryption.
Ограничить использование только URL-адресами из разрешённого списка
Если вы используете идентификатор Microsoft Entra для проверки подлинности с помощью Azure DevOps, список разрешений по умолчанию ограничивает URL-адреса Git следующим образом:
- dev.azure.com
- visualstudio.com
For Microsoft Entra ID with custom CNAMES or Git URL aliases, your workspace admin can configure a custom allow list as shown in the following steps. Если вы используете настраиваемый список разрешений, администратор рабочей области должен добавить эти URL-адреса, если вы хотите работать с ними: dev.azure.com
и visualstudio.com
.
A workspace admin can limit which remote repositories users can clone from and commit & push to. Это помогает предотвратить кражу кода; Например, пользователи не могут отправлять код в произвольный репозиторий, если вы включили ограничения списка разрешений. Кроме того, можно запретить пользователям использовать нелицензированный код, ограничив операцию клонирования списком разрешенных репозиториев.
Чтобы настроить список разрешений, выполните следующие действия.
Go to the settings page.
Click the Workspace admin tab (it is open by default).
In the Development section, choose an option from Git URL allow list permission:
- отключено (без ограничений): проверки относительно списка разрешений не выполняются.
- Restrict Clone, Commit & Push to Allowed Git Repositories: Clone, commit, and push operations are allowed only for repository URLs in the allow list.
- Only Restrict Commit & Push to Allowed Git Repositories: Commit and push operations are allowed only for repository URLs in the allow list. Clone and pull operations are not restricted.
Click the Edit button next to Git URL allow list: Empty list and enter a comma-separated list of URL prefixes.
Click Save.
Note
- Сохраненный список перезаписывает существующий набор префиксов сохраненного URL-адреса.
- It can take up to 15 minutes for the changes to take effect.
Allow access to all repositories
Чтобы отключить существующий список разрешений и разрешить доступ ко всем репозиториям:
- Go to the settings page.
- Click the Workspace admin tab.
- In the Development section, under Git URL allow list permission: select Disable (no restrictions).
Control access for a repo in your workspace
Note
Access control is available only in the Premium plan.
Задайте разрешения для репозитория для управления доступом. Permissions for a repo apply to all content in that repo. You can assign five permission levels to files: NO PERMISSIONS, CAN READ, CAN RUN, CAN EDIT, and CAN MANAGE.
For more details on Git folder permissions, see Git folder ACLs.
Audit logging
When audit logging is enabled, audit events are logged when you interact with a Git folder. Например, событие аудита регистрируется при создании, обновлении или удалении папки Git, при перечислении всех папок Git, связанных с рабочей областью, и при синхронизации изменений между папкой Git и удаленным репозиторием Git.
Secrets detection
Git folders scan code for access key IDs that begin with the prefix AKIA
and warns the user before committing.
Use a repo config file
You can add settings for each notebook to your repo in a .databricks/commit_outputs
file that you create manually.
Specify the notebook you want to include outputs using patterns similar to gitignore patterns.
Patterns for a repo config file
The file contains positive and negative file path patterns. File path patterns include notebook file extension such as .ipynb
.
- Positive patterns enable outputs inclusion for matching notebooks.
- Negative patterns disable outputs inclusion for matching notebooks.
Patterns are evaluated in order for all notebooks. Invalid paths or paths not resolving to .ipynb
notebooks are ignored.
To include outputs from a notebook pathfolder/innerfolder/notebook.ipynb
, use following patterns:
**/*
folder/**
folder/innerfolder/note*
To exclude outputs for a notebook, check that none of the positive patterns match or add a negative pattern in a correct spot of the configuration file. Negative (exclude) patterns start with !
:
!folder/innerfolder/*.ipynb
!folder/**/*.ipynb
!**/notebook.ipynb
Move Git folder to trash (delete)
To delete a Git folder from your workspace:
Щелкните правой кнопкой мыши папку Git и выберите Переместить в корзину.
In the dialog box, type the name of the Git folder you want to delete. Then, click Confirm & move to trash.