Skip to main content

users

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

Overview

Nameusers
TypeResource
Iddatabricks_workspace.iamv2.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe accountId parent of the user in Databricks.
external_idstringExternalId of the user in the customer's IdP.
internal_idstringInternal userId of the user in Databricks.
full_nameobject
account_user_statusstringThe activity status of a user in a Databricks account. (ACTIVE, INACTIVE)
usernamestringUsername/email of the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectinternal_id, deployment_nameFetches a user by its internal ID from the Databricks account that parents the calling workspace.
listselectdeployment_namefilter, page_size, page_tokenLists the users in the Databricks account that parents the calling workspace, returning one page per
createinsertdeployment_name, userCreates a user in the Databricks account that parents the calling workspace and returns the resulting
updateupdateinternal_id, update_mask, deployment_name, userUpdates an existing user in the Databricks account that parents the calling workspace. Only the fields
deletedeleteinternal_id, deployment_nameDeletes a user by its internal ID from the Databricks account that parents the calling workspace.
resolveexecdeployment_name, external_idResolves a user with the given external ID from the customer's IdP. If the user does not exist, it

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)
internal_idstringRequired. Internal ID of the user in Databricks.
update_maskstringOptional. The list of fields to update.
filterstringOptional. Allows filtering users by username or external id.
page_sizeintegerThe maximum number of users to return. The service may return fewer than this value.
page_tokenstringA page token, received from a previous ListUsers call. Provide this to retrieve the subsequent page.

SELECT examples

Fetches a user by its internal ID from the Databricks account that parents the calling workspace.

SELECT
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username
FROM databricks_workspace.iamv2.users
WHERE internal_id = '{{ internal_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a user in the Databricks account that parents the calling workspace and returns the resulting

INSERT INTO databricks_workspace.iamv2.users (
user,
deployment_name
)
SELECT
'{{ user }}' /* required */,
'{{ deployment_name }}'
RETURNING
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username
;

UPDATE examples

Updates an existing user in the Databricks account that parents the calling workspace. Only the fields

UPDATE databricks_workspace.iamv2.users
SET
user = '{{ user }}'
WHERE
internal_id = '{{ internal_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND user = '{{ user }}' --required
RETURNING
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username;

DELETE examples

Deletes a user by its internal ID from the Databricks account that parents the calling workspace.

DELETE FROM databricks_workspace.iamv2.users
WHERE internal_id = '{{ internal_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

Resolves a user with the given external ID from the customer's IdP. If the user does not exist, it

EXEC databricks_workspace.iamv2.users.resolve
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"external_id": "{{ external_id }}"
}'
;