Access the MLflow tracking server from outside Databricks

You may wish to log to the MLflow tracking server from your own applications. This article describes the required configuration steps. Start by installing MLflow and configuring your credentials (Step 1). Next, configure an application (Step 2).

For information on how to launch and log to an open-source tracking server, see the MLflow open source documentation.

Step 1: Configure your environment

To configure your environment to access your Databricks hosted MLflow tracking server:

  1. Install MLflow using pip install mlflow.

  2. Configure authentication

    1. Generate a REST API token

    2. Specify credentials using your token and setting environment variables:

      # Configure MLflow to communicate with a Databricks-hosted tracking server
      export MLFLOW_TRACKING_URI=databricks
      # Specify the workspace hostname and token
      export DATABRICKS_HOST="..."
      export DATABRICKS_TOKEN="..."
      

Step 2: Configure MLflow applications

Configure MLflow applications to log to Databricks by setting the tracking URI to databricks, or databricks://<profileName>, if you specified a profile name via --profile while creating your credentials file. For example, you can achieve this by setting the MLFLOW_TRACKING_URI environment variable to “databricks”.