Skip to main content

users_v2

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

Overview

Nameusers_v2
TypeResource
Iddatabricks_workspace.iam.users_v2

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDatabricks user ID.
nameobject
activeboolean
displayNamestringString that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to update `displayName`. [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation
emailsarrayAll the emails associated with the Databricks user.
entitlementsarrayEntitlements assigned to the user. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
externalIdstringExternal ID is not currently supported. It is reserved for future use.
groupsarray
rolesarrayCorresponds to AWS instance profile/arn role.
schemasarrayThe schema of the user.
userNamestringEmail address of the Databricks user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, deployment_nameattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets information for a specific user in Databricks workspace.
listselectdeployment_nameattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets details for all the users associated with a Databricks workspace.
createinsertdeployment_nameCreates a new user in the Databricks workspace. This new user will also be added to the Databricks
patchupdateid, deployment_namePartially updates a user resource by applying the supplied operations on specific user attributes.
replacereplaceid, deployment_nameReplaces a user's information with the data supplied in request.
deletedeleteid, deployment_nameDeletes a user. Deleting a user from a Databricks workspace also removes objects associated with the

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)
idstringUnique ID for a user in the Databricks workspace.
attributesstringComma-separated list of attributes to return in response.
countintegerDesired number of results per page.
excluded_attributesstringComma-separated list of attributes to exclude in response.
filterstringQuery by which the results have to be filtered. Supported operators are equals(eq), contains(co), starts with(sw) and not equals(ne). Additionally, simple expressions can be formed using logical operators - and and or. The [SCIM RFC] has more details but we currently only support simple expressions. [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
sort_bystringAttribute to sort the results. Multi-part paths are supported. For example, userName, name.givenName, and emails.
sort_orderstringThe order to sort the results.
start_indexintegerSpecifies the index of the first result. First item is number 1.

SELECT examples

Gets information for a specific user in Databricks workspace.

SELECT
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
FROM databricks_workspace.iam.users_v2
WHERE id = '{{ id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND attributes = '{{ attributes }}'
AND count = '{{ count }}'
AND excluded_attributes = '{{ excluded_attributes }}'
AND filter = '{{ filter }}'
AND sort_by = '{{ sort_by }}'
AND sort_order = '{{ sort_order }}'
AND start_index = '{{ start_index }}'
;

INSERT examples

Creates a new user in the Databricks workspace. This new user will also be added to the Databricks

INSERT INTO databricks_workspace.iam.users_v2 (
active,
display_name,
emails,
entitlements,
external_id,
groups,
id,
name,
roles,
schemas,
user_name,
deployment_name
)
SELECT
{{ active }},
'{{ display_name }}',
'{{ emails }}',
'{{ entitlements }}',
'{{ external_id }}',
'{{ groups }}',
'{{ id }}',
'{{ name }}',
'{{ roles }}',
'{{ schemas }}',
'{{ user_name }}',
'{{ deployment_name }}'
RETURNING
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
;

UPDATE examples

Partially updates a user resource by applying the supplied operations on specific user attributes.

UPDATE databricks_workspace.iam.users_v2
SET
operations = '{{ operations }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;

REPLACE examples

Replaces a user's information with the data supplied in request.

REPLACE databricks_workspace.iam.users_v2
SET
active = {{ active }},
display_name = '{{ display_name }}',
emails = '{{ emails }}',
entitlements = '{{ entitlements }}',
external_id = '{{ external_id }}',
groups = '{{ groups }}',
name = '{{ name }}',
roles = '{{ roles }}',
schemas = '{{ schemas }}',
user_name = '{{ user_name }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the

DELETE FROM databricks_workspace.iam.users_v2
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;