Skip to contents

Inserts a secret under the provided scope with the given name. If a secret already exists with the same name, this command overwrites the existing secret's value. The server encrypts the secret using the secret scope's encryption settings before storing it.

Usage

put_secret(client, scope, key, bytes_value = NULL, string_value = NULL)

secretsPutSecret(client, scope, key, bytes_value = NULL, string_value = NULL)

Arguments

client

Required. Instance of DatabricksClient()

scope

Required. The name of the scope to which the secret will be associated with.

key

Required. A unique name to identify the secret.

bytes_value

If specified, value will be stored as bytes.

string_value

If specified, note that the value will be stored in UTF-8 (MB4) form.

Details

You must have WRITE or MANAGE permission on the secret scope. The secret key must consist of alphanumeric characters, dashes, underscores, and periods, and cannot exceed 128 characters. The maximum allowed secret value size is 128 KB. The maximum number of secrets in a given scope is 1000.

The input fields 'string_value' or 'bytes_value' specify the type of the secret, which will determine the value returned when the secret value is requested. Exactly one must be specified.

Throws RESOURCE_DOES_NOT_EXIST if no such secret scope exists. Throws RESOURCE_LIMIT_EXCEEDED if maximum number of secrets in scope is exceeded. Throws INVALID_PARAMETER_VALUE if the key name or value length is invalid. Throws PERMISSION_DENIED if the user does not have permission to make this API call.