Skip to main content

git_credentials

Creates, updates, deletes, gets or lists a git_credentials resource.

Overview

Namegit_credentials
TypeResource
Iddatabricks_workspace.repos.git_credentials

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
credential_idstring
git_providerstring
git_usernamestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets the Git credential with the specified credential ID.
listselectdeployment_nameLists the calling user's Git credentials. One credential per user is supported.
createinsertdeployment_nameCreates a Git credential entry for the user. Only one Git credential per user is supported, so any attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.
updateupdatedeployment_nameUpdates the specified Git credential.
deletedeletedeployment_nameDeletes the specified Git credential.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Gets the Git credential with the specified credential ID.

SELECT
credential_id,
git_provider,
git_username
FROM databricks_workspace.repos.git_credentials
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a Git credential entry for the user. Only one Git credential per user is supported, so any attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.

INSERT INTO databricks_workspace.repos.git_credentials (
data__git_provider,
data__git_username,
data__personal_access_token,
deployment_name
)
SELECT
'{{ git_provider }}',
'{{ git_username }}',
'{{ personal_access_token }}',
'{{ deployment_name }}'
RETURNING
credential_id,
git_provider,
git_username
;

UPDATE examples

Updates the specified Git credential.

UPDATE databricks_workspace.repos.git_credentials
SET
data__personal_access_token = '{{ personal_access_token }}',
data__git_provider = '{{ git_provider }}',
data__git_username = '{{ git_username }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes the specified Git credential.

DELETE FROM databricks_workspace.repos.git_credentials
WHERE deployment_name = '{{ deployment_name }}' --required;