databricksmlflowexperiment Resource
July 29, 2026 ยท View on GitHub
This resource allows you to manage MLflow experiments in Databricks.
-> This resource can only be used with a workspace-level provider!
Example Usage
data "databricks_current_user" "me" {}
resource "databricks_mlflow_experiment" "this" {
name = "${data.databricks_current_user.me.home}/Sample"
artifact_location = "s3://bucket/my-experiment"
tags {
key = "key1"
value = "value1"
}
tags {
key = "key2"
value = "value2"
}
}
# Store this experiment's traces in a Unity Catalog schema
resource "databricks_mlflow_experiment" "with_uc_traces" {
name = "${data.databricks_current_user.me.home}/uc-traces-experiment"
trace_location {
uc_trace_location {
catalog = "my_catalog"
schema = "my_schema"
table_prefix = "my_experiment"
}
}
}
Argument Reference
The following arguments are supported:
name- (Required) Name of MLflow experiment. It must be an absolute path within the Databricks workspace, e.g./Users/<some-username>/my-experiment. For more information about changes to experiment naming conventions, see mlflow docs.artifact_location- Path to artifact location of the MLflow experiment.tags- Tags for the MLflow experiment.trace_location- (Optional, Immutable) Unity Catalog location where the experiment's traces are stored. Cannot be changed after the experiment is created; changing it forces replacement of the experiment. This block consists of the following fields:uc_trace_location- (Required) The Unity Catalog storage location. This block consists of the following fields:catalog- (Required) Name of the Unity Catalog catalog.schema- (Required) Name of the Unity Catalog schema withincatalog.table_prefix- (Optional) Prefix for the generated trace tables (named{catalog}.{schema}.{table_prefix}_otel_*). If omitted, the server generates a default prefix derived from the experiment ID; the field then stays empty and the resolved value is available ineffective_table_prefix.effective_table_prefix- (Computed) The trace-table prefix actually in effect:table_prefixif it was set on creation, otherwise the server-generated default.
provider_config- (Optional) Configure the provider for management through account provider. This block consists of the following fields:workspace_id- (Required) Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
Attribute Reference
In addition to all arguments above, the following attributes are exported:
id- ID of the MLflow experiment.
Access Control
- databricks_permissions can control which groups or individual users can Read, Edit, or Manage individual experiments.
Import
The experiment resource can be imported using the id of the experiment:
import {
to = databricks_mlflow_experiment.this
id = "<experiment-id>"
}
Alternatively, when using terraform version 1.4 or earlier, import using the terraform import command:
terraform import databricks_mlflow_experiment.this "<experiment-id>"
Related Resources
The following resources are often used in the same context:
- databricks_registered_model to create Models in Unity Catalog in Databricks.
- End to end workspace management guide.
- databricks_directory to manage directories in Databricks Workpace.
- databricks_mlflow_model to create models in the workspace model registry in Databricks.
- databricks_notebook to manage Databricks Notebooks.
- databricks_notebook data to export a notebook from Databricks Workspace.
- databricks_repo to manage Databricks Repos.