account service-principals command group
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
The account service-principals command group within the Databricks CLI contains commands to perform create, get, list, update, and delete operations on service principals. Service principals are identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. Databricks recommends creating service principals to run production jobs or modify production data. See Service principals.
databricks account service-principals create
Create a new service principal in the Databricks account.
databricks account service-principals create [flags]
Options
--active
If this service principal is active.
--application-id string
UUID relating to the service principal.
--display-name string
String that represents a concatenation of given and family names.
--external-id string
External ID for the service principal.
--id string
Databricks service principal ID.
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example creates a service principal using command-line flags:
databricks account service-principals create --application-id "12345678-1234-1234-1234-123456789abc" --display-name "CI/CD Pipeline"
The following example creates a service principal using JSON:
databricks account service-principals create --json '{"applicationId": "12345678-1234-1234-1234-123456789abc", "displayName": "CI/CD Pipeline", "active": true}'
The following example creates a service principal using a JSON file:
databricks account service-principals create --json @service-principal.json
databricks account service-principals delete
Delete a single service principal in the Databricks account.
databricks account service-principals delete ID [flags]
Arguments
ID
Unique ID for a service principal in the Databricks account.
Options
Examples
The following example deletes a service principal by ID:
databricks account service-principals delete 12345
databricks account service-principals get
Get the details for a single service principal defined in the Databricks account.
databricks account service-principals get ID [flags]
Arguments
ID
Unique ID for a service principal in the Databricks account.
Options
Examples
The following example gets a service principal by ID:
databricks account service-principals get 12345
databricks account service-principals list
Get the set of service principals associated with a Databricks account.
databricks account service-principals list [flags]
Options
--attributes string
Comma-separated list of attributes to return in response.
--count int
Desired number of results per page.
--excluded-attributes string
Comma-separated list of attributes to exclude in response.
--filter string
Query by which the results have to be filtered.
--sort-by string
Attribute to sort the results.
--sort-order ListSortOrder
The order to sort the results. Supported values: ascending, descending.
--start-index int
Specifies the index of the first result.
Examples
The following example lists all service principals:
databricks account service-principals list
The following example lists service principals with pagination:
databricks account service-principals list --count 10 --start-index 0
The following example lists service principals with a filter:
databricks account service-principals list --filter "displayName eq \"CI/CD Pipeline\""
databricks account service-principals patch
Partially update the details of a single service principal in the Databricks account.
databricks account service-principals patch ID [flags]
Arguments
ID
Unique ID in the Databricks workspace.
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example patches a service principal using JSON:
databricks account service-principals patch 12345 --json '{"displayName": "Updated CI/CD Pipeline"}'
The following example patches a service principal using a JSON file:
databricks account service-principals patch 12345 --json @patch-service-principal.json
databricks account service-principals update
Update the details of a single service principal by replacing the entire service principal entity.
databricks account service-principals update ID [flags]
Arguments
ID
Databricks service principal ID.
Options
--active
If this service principal is active.
--application-id string
UUID relating to the service principal.
--display-name string
String that represents a concatenation of given and family names.
--external-id string
External ID for the service principal.
--id string
Databricks service principal ID.
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example updates a service principal using command-line flags:
databricks account service-principals update 12345 --display-name "Updated CI/CD Pipeline" --active
The following example updates a service principal using JSON:
databricks account service-principals update 12345 --json '{"displayName": "Updated CI/CD Pipeline", "active": true}'
The following example updates a service principal using a JSON file:
databricks account service-principals update 12345 --json @update-service-principal.json
Global flags
--debug
Whether to enable debug logging.
-h or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format format
The log format type, text or json. The default value is text.
--log-level string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output type
The command output type, text or json. The default value is text.
-p, --profile string
The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.
--progress-format format
The format to display progress logs: default, append, inplace, or json
-t, --target string
If applicable, the bundle target to use