LoslegenKostenlos loslegen

Default authentication

The Databricks SDK exposes a Workspace Client class that you will use throughout this course to interact with a Databricks workspace. By default, this class is instantiated without parameters, as the SDK automatically retrieves the environment variables needed to authenticate to a Databricks workspace.

The variable dbrx_host, containing the address of the Databricks host, has been preloaded.

Diese Übung ist Teil des Kurses

Databricks with the Python SDK

Kurs anzeigen

Anleitung zur Übung

  • Import the class from the Databricks SDK that contains the Workspace Client.
  • Use the os library to set the authentication environment variable to the predefined dbrx_host.
  • Create a Workspace Client object using default authentication.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

import os
# Import the workspace client
from databricks.sdk import ____

# Set the Databricks authentication environment variables
os.environ['____'] = dbrx_host

# Instantiate the Workspace Client
workspace_client = ____()
Code bearbeiten und ausführen