Skip to main content

current_user

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

Overview​

Namecurrent_user
TypeResource
Iddatabricks_workspace.iam.current_user

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 <https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation>`__. Use Account SCIM APIs to update ``displayName``.
â–¶emailsarrayAll the emails associated with the Databricks user. This attribute cannot be updated through the SCIM PATCH or PUT APIs; any supplied change is ignored.
â–¶entitlementsarrayEntitlements assigned to the user. See `assigning entitlements <https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements>`__ for a full list of supported values.
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. This attribute cannot be updated through the SCIM PATCH or PUT APIs; any supplied change is ignored.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameattributes, excluded_attributesGet details about the current method caller's identity.

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)
attributesstringComma-separated list of attributes to return in response.
excluded_attributesstringComma-separated list of attributes to exclude in response.

SELECT examples​

Get details about the current method caller's identity.

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