Databricks Data Engineer Professional Question 295
Single answerYou are tasked with configuring the Databricks CLI on your local machine to interact with a Databricks workspace. After successfully configuring the CLI, you want to list all the clusters in your workspace. Which sequence of steps should you follow to accomplish this?
- A
Run the
databricks clusters listcommand directly after installing the CLI. - B
Generate a Databricks personal access token, configure the CLI with the token and workspace URL, then run the
databricks clusters listcommand. - C
Run the
databricks configurecommand, provide your username and password, then execute thedatabricks clusters listcommand. - D
Install the Databricks CLI, then run the
databricks clusters listcommand without any additional configuration steps.
Show answer and explanation
Correct answer: B
Explanation
To use the Databricks CLI, you must first configure it by providing authentication details such as a personal access token and workspace URL. Once configured, you can execute commands like databricks clusters list to interact with the workspace. The correct sequence involves generating a personal access token in Databricks, configuring the CLI with the appropriate credentials, and then running the desired command.
- A. Incorrect.
This option is incorrect because the Databricks CLI requires authentication and workspace configuration before executing commands like
databricks clusters list. - B. Correct.
This is correct because configuring the CLI with a personal access token and workspace URL is required for authentication. Once configured properly, the
databricks clusters listcommand can be used to list clusters in the workspace. - C. Incorrect.
This option is incorrect because the
databricks configurecommand supports only authentication via personal access tokens and not username/password authentication. - D. Incorrect.
This option is incorrect because the CLI must be configured with authentication details (e.g., personal access token and workspace URL) before running any commands.