Skip to main content

external-locations command group

note

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

The external-locations command group within the Databricks CLI contains commands to create and manage external locations for Unity Catalog. See What are Unity Catalog volumes?.

databricks external-locations create​

Create a new external location entry in the metastore. The caller must be a metastore admin or have the CREATE_EXTERNAL_LOCATION privilege on both the metastore and the associated storage credential.

databricks external-locations create NAME URL CREDENTIAL_NAME [flags]

Arguments​

NAME

    Name of the external location.

URL

    Path URL of the external location.

CREDENTIAL_NAME

    Name of the storage credential used with this location.

Options​

--comment string

    User-provided free-form text description.

--enable-file-events

    Whether to enable file events on this external location.

--fallback

    Indicates whether fallback mode is enabled for this external location.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--read-only

    Indicates whether the external location is read-only.

--skip-validation

    Skips validation of the storage credential associated with the external location.

Global flags

Examples​

The following example creates an external location with a comment:

Bash
databricks external-locations create my-external-location s3://my-bucket/path my-credential --comment "External location for data lake"

The following example creates a read-only external location:

Bash
databricks external-locations create my-external-location s3://my-bucket/path my-credential --read-only

databricks external-locations delete​

Delete the specified external location from the metastore. The caller must be the owner of the external location.

databricks external-locations delete NAME [flags]

Arguments​

NAME

    Name of the external location.

Options​

--force

    Force deletion even if there are dependent external tables or mounts.

Global flags

Examples​

The following example deletes an external location named my-external-location:

Bash
databricks external-locations delete my-external-location

The following example forcefully deletes an external location even if there are dependencies:

Bash
databricks external-locations delete my-external-location --force

databricks external-locations get​

Get an external location from the metastore. The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location.

databricks external-locations get NAME [flags]

Arguments​

NAME

    Name of the external location.

Options​

--include-browse

    Whether to include external locations in the response for which the principal can only access selective metadata for.

Global flags

Examples​

The following example gets information about an external location named my-external-location:

Bash
databricks external-locations get my-external-location

The following example gets information including browse metadata:

Bash
databricks external-locations get my-external-location --include-browse

databricks external-locations list​

List external locations from the metastore. The caller must be a metastore admin, the owner of the external location, or a user that has some privilege on the external location. There is no guarantee of a specific ordering of the elements in the array.

databricks external-locations list [flags]

Options​

--include-browse

    Whether to include external locations in the response for which the principal can only access selective metadata for.

--include-unbound

    Whether to include external locations not bound to the workspace.

--limit int

    Maximum number of external locations to return.

Global flags

Examples​

The following example lists all external locations:

Bash
databricks external-locations list

The following example lists external locations with a maximum of 10 results:

Bash
databricks external-locations list --limit 10

databricks external-locations update​

Update an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location.

databricks external-locations update NAME [flags]

Arguments​

NAME

    Name of the external location.

Options​

--comment string

    User-provided free-form text description.

--credential-name string

    Name of the storage credential used with this location.

--enable-file-events

    Whether to enable file events on this external location.

--fallback

    Indicates whether fallback mode is enabled for this external location.

--force

    Force update even if changing url invalidates dependent external tables or mounts.

--isolation-mode IsolationMode

    Supported values: ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--new-name string

    New name for the external location.

--owner string

    The owner of the external location.

--read-only

    Indicates whether the external location is read-only.

--skip-validation

    Skips validation of the storage credential associated with the external location.

--url string

    Path URL of the external location.

Global flags

Examples​

The following example renames an external location:

Bash
databricks external-locations update my-external-location --new-name my-renamed-location

The following example changes the owner of an external location:

Bash
databricks external-locations update my-external-location --owner someone@example.com

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