turbot/databricks
steampipe plugin install databricks

Table: databricks_workspace_git_credential - Query Databricks Workspace Git Credentials using SQL

Databricks Workspace is a collaborative environment for data engineers, data scientists, machine learning engineers, and business users. It allows these users to create, share, and collaborate on Databricks notebooks, jobs, and data. Git Credentials in Databricks Workspace are used to connect to Git repositories and allow users to version control notebooks and other work in their workspace.

Table Usage Guide

The databricks_workspace_git_credential table provides insights into the Git credentials configured in Databricks workspaces. As a data engineer or data scientist, explore the details of these credentials through this table, including the URL of the Git repository, the username used for authentication, and the last time the credentials were updated. Utilize it to manage and monitor the use of Git repositories in your Databricks workspaces.

Examples

Basic info

Explore which credentials are associated with specific Git providers and usernames in your Databricks workspace. This can be useful in managing and auditing access to your code repositories.

select
credential_id,
git_provider,
git_username,
account_id
from
databricks_workspace_git_credential;
select
credential_id,
git_provider,
git_username,
account_id
from
databricks_workspace_git_credential;

Get git credential info for gitHub

Gain insights into the GitHub credentials used within your Databricks workspace. This can be useful for understanding the distribution of different user accounts linked to your workspace, aiding in user management and security.

select
credential_id,
git_provider,
git_username,
account_id
from
databricks_workspace_git_credential
where
git_provider = 'gitHub';
select
credential_id,
git_provider,
git_username,
account_id
from
databricks_workspace_git_credential
where
git_provider = 'gitHub';

List the account in order of git credentials

Analyze the settings to understand the distribution of Git credentials across various accounts. This is useful for identifying accounts that might be overusing or underutilizing Git credentials, aiding in resource allocation and potential security auditing.

select
account_id,
count(*) as git_cred_count
from
databricks_workspace_git_credential
group by
account_id
order by
git_cred_count desc;
select
account_id,
count(*) as git_cred_count
from
databricks_workspace_git_credential
group by
account_id
order by
git_cred_count desc;

Schema for databricks_workspace_git_credential

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe Databricks Account ID in which the resource is located.
credential_idbigint=ID of the credential object in the workspace.
git_providertext=The git provider.
git_usernametextThe git username.
titletextThe title of the resource.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- databricks

You can pass the configuration to the command with the --config argument:

steampipe_export_databricks --config '<your_config>' databricks_workspace_git_credential