Skip to main content

token_management

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

Overview

Nametoken_management
TypeResource
Iddatabricks_workspace.settings.token_management

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
token_infoobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttoken_id, deployment_nameGets information about a token, specified by its ID.
listselectdeployment_namecreated_by_id, created_by_usernameLists all tokens associated with the specified workspace or user.
createinsertdeployment_name, application_idCreates a token on behalf of a service principal.
deletedeletetoken_id, deployment_nameDeletes a token, specified by its ID.

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)
token_idstringThe ID of the token to revoke.
created_by_idintegerUser ID of the user that created the token.
created_by_usernamestringUsername of the user that created the token.

SELECT examples

Gets information about a token, specified by its ID.

SELECT
token_info
FROM databricks_workspace.settings.token_management
WHERE token_id = '{{ token_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a token on behalf of a service principal.

INSERT INTO databricks_workspace.settings.token_management (
application_id,
comment,
lifetime_seconds,
deployment_name
)
SELECT
'{{ application_id }}' /* required */,
'{{ comment }}',
{{ lifetime_seconds }},
'{{ deployment_name }}'
RETURNING
token_info,
token_value
;

DELETE examples

Deletes a token, specified by its ID.

DELETE FROM databricks_workspace.settings.token_management
WHERE token_id = '{{ token_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;