1. Packages
  2. Databricks Provider
  3. API Docs
  4. MlflowExperiment
Databricks v1.68.0 published on Friday, Apr 25, 2025 by Pulumi

databricks.MlflowExperiment

Explore with Pulumi AI

databricks logo
Databricks v1.68.0 published on Friday, Apr 25, 2025 by Pulumi

    This resource allows you to manage MLflow experiments in Databricks.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const me = databricks.getCurrentUser({});
    const _this = new databricks.MlflowExperiment("this", {
        name: me.then(me => `${me.home}/Sample`),
        artifactLocation: "dbfs:/tmp/my-experiment",
        tags: [
            {
                key: "key1",
                value: "value1",
            },
            {
                key: "key2",
                value: "value2",
            },
        ],
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    me = databricks.get_current_user()
    this = databricks.MlflowExperiment("this",
        name=f"{me.home}/Sample",
        artifact_location="dbfs:/tmp/my-experiment",
        tags=[
            {
                "key": "key1",
                "value": "value1",
            },
            {
                "key": "key2",
                "value": "value2",
            },
        ])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		me, err := databricks.GetCurrentUser(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewMlflowExperiment(ctx, "this", &databricks.MlflowExperimentArgs{
    			Name:             pulumi.Sprintf("%v/Sample", me.Home),
    			ArtifactLocation: pulumi.String("dbfs:/tmp/my-experiment"),
    			Tags: databricks.MlflowExperimentTagArray{
    				&databricks.MlflowExperimentTagArgs{
    					Key:   pulumi.String("key1"),
    					Value: pulumi.String("value1"),
    				},
    				&databricks.MlflowExperimentTagArgs{
    					Key:   pulumi.String("key2"),
    					Value: pulumi.String("value2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var me = Databricks.GetCurrentUser.Invoke();
    
        var @this = new Databricks.MlflowExperiment("this", new()
        {
            Name = $"{me.Apply(getCurrentUserResult => getCurrentUserResult.Home)}/Sample",
            ArtifactLocation = "dbfs:/tmp/my-experiment",
            Tags = new[]
            {
                new Databricks.Inputs.MlflowExperimentTagArgs
                {
                    Key = "key1",
                    Value = "value1",
                },
                new Databricks.Inputs.MlflowExperimentTagArgs
                {
                    Key = "key2",
                    Value = "value2",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.DatabricksFunctions;
    import com.pulumi.databricks.MlflowExperiment;
    import com.pulumi.databricks.MlflowExperimentArgs;
    import com.pulumi.databricks.inputs.MlflowExperimentTagArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var me = DatabricksFunctions.getCurrentUser(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            var this_ = new MlflowExperiment("this", MlflowExperimentArgs.builder()
                .name(String.format("%s/Sample", me.home()))
                .artifactLocation("dbfs:/tmp/my-experiment")
                .tags(            
                    MlflowExperimentTagArgs.builder()
                        .key("key1")
                        .value("value1")
                        .build(),
                    MlflowExperimentTagArgs.builder()
                        .key("key2")
                        .value("value2")
                        .build())
                .build());
    
        }
    }
    
    resources:
      this:
        type: databricks:MlflowExperiment
        properties:
          name: ${me.home}/Sample
          artifactLocation: dbfs:/tmp/my-experiment
          tags:
            - key: key1
              value: value1
            - key: key2
              value: value2
    variables:
      me:
        fn::invoke:
          function: databricks:getCurrentUser
          arguments: {}
    

    Access Control

    • databricks.Permissions can control which groups or individual users can Read, Edit, or Manage individual experiments.

    The following resources are often used in the same context:

    Create MlflowExperiment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MlflowExperiment(name: string, args?: MlflowExperimentArgs, opts?: CustomResourceOptions);
    @overload
    def MlflowExperiment(resource_name: str,
                         args: Optional[MlflowExperimentArgs] = None,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def MlflowExperiment(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         artifact_location: Optional[str] = None,
                         creation_time: Optional[int] = None,
                         description: Optional[str] = None,
                         experiment_id: Optional[str] = None,
                         last_update_time: Optional[int] = None,
                         lifecycle_stage: Optional[str] = None,
                         name: Optional[str] = None,
                         tags: Optional[Sequence[MlflowExperimentTagArgs]] = None)
    func NewMlflowExperiment(ctx *Context, name string, args *MlflowExperimentArgs, opts ...ResourceOption) (*MlflowExperiment, error)
    public MlflowExperiment(string name, MlflowExperimentArgs? args = null, CustomResourceOptions? opts = null)
    public MlflowExperiment(String name, MlflowExperimentArgs args)
    public MlflowExperiment(String name, MlflowExperimentArgs args, CustomResourceOptions options)
    
    type: databricks:MlflowExperiment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MlflowExperimentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MlflowExperimentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MlflowExperimentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MlflowExperimentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MlflowExperimentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var mlflowExperimentResource = new Databricks.MlflowExperiment("mlflowExperimentResource", new()
    {
        ArtifactLocation = "string",
        CreationTime = 0,
        ExperimentId = "string",
        LastUpdateTime = 0,
        LifecycleStage = "string",
        Name = "string",
        Tags = new[]
        {
            new Databricks.Inputs.MlflowExperimentTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
    });
    
    example, err := databricks.NewMlflowExperiment(ctx, "mlflowExperimentResource", &databricks.MlflowExperimentArgs{
    	ArtifactLocation: pulumi.String("string"),
    	CreationTime:     pulumi.Int(0),
    	ExperimentId:     pulumi.String("string"),
    	LastUpdateTime:   pulumi.Int(0),
    	LifecycleStage:   pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	Tags: databricks.MlflowExperimentTagArray{
    		&databricks.MlflowExperimentTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    })
    
    var mlflowExperimentResource = new MlflowExperiment("mlflowExperimentResource", MlflowExperimentArgs.builder()
        .artifactLocation("string")
        .creationTime(0)
        .experimentId("string")
        .lastUpdateTime(0)
        .lifecycleStage("string")
        .name("string")
        .tags(MlflowExperimentTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .build());
    
    mlflow_experiment_resource = databricks.MlflowExperiment("mlflowExperimentResource",
        artifact_location="string",
        creation_time=0,
        experiment_id="string",
        last_update_time=0,
        lifecycle_stage="string",
        name="string",
        tags=[{
            "key": "string",
            "value": "string",
        }])
    
    const mlflowExperimentResource = new databricks.MlflowExperiment("mlflowExperimentResource", {
        artifactLocation: "string",
        creationTime: 0,
        experimentId: "string",
        lastUpdateTime: 0,
        lifecycleStage: "string",
        name: "string",
        tags: [{
            key: "string",
            value: "string",
        }],
    });
    
    type: databricks:MlflowExperiment
    properties:
        artifactLocation: string
        creationTime: 0
        experimentId: string
        lastUpdateTime: 0
        lifecycleStage: string
        name: string
        tags:
            - key: string
              value: string
    

    MlflowExperiment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The MlflowExperiment resource accepts the following input properties:

    ArtifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    CreationTime int
    Description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    ExperimentId string
    LastUpdateTime int
    LifecycleStage string
    Name string
    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.
    Tags List<MlflowExperimentTag>
    Tags for the MLflow experiment.
    ArtifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    CreationTime int
    Description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    ExperimentId string
    LastUpdateTime int
    LifecycleStage string
    Name string
    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.
    Tags []MlflowExperimentTagArgs
    Tags for the MLflow experiment.
    artifactLocation String
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime Integer
    description String

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId String
    lastUpdateTime Integer
    lifecycleStage String
    name String
    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.
    tags List<MlflowExperimentTag>
    Tags for the MLflow experiment.
    artifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime number
    description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId string
    lastUpdateTime number
    lifecycleStage string
    name string
    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.
    tags MlflowExperimentTag[]
    Tags for the MLflow experiment.
    artifact_location str
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creation_time int
    description str

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experiment_id str
    last_update_time int
    lifecycle_stage str
    name str
    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.
    tags Sequence[MlflowExperimentTagArgs]
    Tags for the MLflow experiment.
    artifactLocation String
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime Number
    description String

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId String
    lastUpdateTime Number
    lifecycleStage String
    name String
    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.
    tags List<Property Map>
    Tags for the MLflow experiment.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MlflowExperiment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MlflowExperiment Resource

    Get an existing MlflowExperiment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: MlflowExperimentState, opts?: CustomResourceOptions): MlflowExperiment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            artifact_location: Optional[str] = None,
            creation_time: Optional[int] = None,
            description: Optional[str] = None,
            experiment_id: Optional[str] = None,
            last_update_time: Optional[int] = None,
            lifecycle_stage: Optional[str] = None,
            name: Optional[str] = None,
            tags: Optional[Sequence[MlflowExperimentTagArgs]] = None) -> MlflowExperiment
    func GetMlflowExperiment(ctx *Context, name string, id IDInput, state *MlflowExperimentState, opts ...ResourceOption) (*MlflowExperiment, error)
    public static MlflowExperiment Get(string name, Input<string> id, MlflowExperimentState? state, CustomResourceOptions? opts = null)
    public static MlflowExperiment get(String name, Output<String> id, MlflowExperimentState state, CustomResourceOptions options)
    resources:  _:    type: databricks:MlflowExperiment    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ArtifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    CreationTime int
    Description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    ExperimentId string
    LastUpdateTime int
    LifecycleStage string
    Name string
    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.
    Tags List<MlflowExperimentTag>
    Tags for the MLflow experiment.
    ArtifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    CreationTime int
    Description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    ExperimentId string
    LastUpdateTime int
    LifecycleStage string
    Name string
    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.
    Tags []MlflowExperimentTagArgs
    Tags for the MLflow experiment.
    artifactLocation String
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime Integer
    description String

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId String
    lastUpdateTime Integer
    lifecycleStage String
    name String
    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.
    tags List<MlflowExperimentTag>
    Tags for the MLflow experiment.
    artifactLocation string
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime number
    description string

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId string
    lastUpdateTime number
    lifecycleStage string
    name string
    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.
    tags MlflowExperimentTag[]
    Tags for the MLflow experiment.
    artifact_location str
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creation_time int
    description str

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experiment_id str
    last_update_time int
    lifecycle_stage str
    name str
    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.
    tags Sequence[MlflowExperimentTagArgs]
    Tags for the MLflow experiment.
    artifactLocation String
    Path to dbfs:/ or s3:// artifact location of the MLflow experiment.
    creationTime Number
    description String

    Deprecated: Remove the description attribute as it no longer is used and will be removed in a future version.

    experimentId String
    lastUpdateTime Number
    lifecycleStage String
    name String
    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.
    tags List<Property Map>
    Tags for the MLflow experiment.

    Supporting Types

    MlflowExperimentTag, MlflowExperimentTagArgs

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Import

    The experiment resource can be imported using the id of the experiment

    bash

    $ pulumi import databricks:index/mlflowExperiment:MlflowExperiment this <experiment-id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.68.0 published on Friday, Apr 25, 2025 by Pulumi