1. Packages
  2. Databricks Provider
  3. API Docs
  4. getDbfsFile
Databricks v1.85.0 published on Friday, Feb 13, 2026 by Pulumi
databricks logo
Databricks v1.85.0 published on Friday, Feb 13, 2026 by Pulumi

    This data source allows to get file content from Databricks File System (DBFS).

    This data source can only be used with a workspace-level provider!

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const report = databricks.getDbfsFile({
        path: "dbfs:/reports/some.csv",
        limitFileSize: true,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    report = databricks.get_dbfs_file(path="dbfs:/reports/some.csv",
        limit_file_size=True)
    
    package main
    
    import (
    	"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 {
    		_, err := databricks.LookupDbfsFile(ctx, &databricks.LookupDbfsFileArgs{
    			Path:          "dbfs:/reports/some.csv",
    			LimitFileSize: true,
    		}, nil)
    		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 report = Databricks.GetDbfsFile.Invoke(new()
        {
            Path = "dbfs:/reports/some.csv",
            LimitFileSize = true,
        });
    
    });
    
    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.inputs.GetDbfsFileArgs;
    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 report = DatabricksFunctions.getDbfsFile(GetDbfsFileArgs.builder()
                .path("dbfs:/reports/some.csv")
                .limitFileSize(true)
                .build());
    
        }
    }
    
    variables:
      report:
        fn::invoke:
          function: databricks:getDbfsFile
          arguments:
            path: dbfs:/reports/some.csv
            limitFileSize: 'true'
    

    The following resources are used in the same context:

    Using getDbfsFile

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDbfsFile(args: GetDbfsFileArgs, opts?: InvokeOptions): Promise<GetDbfsFileResult>
    function getDbfsFileOutput(args: GetDbfsFileOutputArgs, opts?: InvokeOptions): Output<GetDbfsFileResult>
    def get_dbfs_file(limit_file_size: Optional[bool] = None,
                      path: Optional[str] = None,
                      provider_config: Optional[GetDbfsFileProviderConfig] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDbfsFileResult
    def get_dbfs_file_output(limit_file_size: Optional[pulumi.Input[bool]] = None,
                      path: Optional[pulumi.Input[str]] = None,
                      provider_config: Optional[pulumi.Input[GetDbfsFileProviderConfigArgs]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDbfsFileResult]
    func LookupDbfsFile(ctx *Context, args *LookupDbfsFileArgs, opts ...InvokeOption) (*LookupDbfsFileResult, error)
    func LookupDbfsFileOutput(ctx *Context, args *LookupDbfsFileOutputArgs, opts ...InvokeOption) LookupDbfsFileResultOutput

    > Note: This function is named LookupDbfsFile in the Go SDK.

    public static class GetDbfsFile 
    {
        public static Task<GetDbfsFileResult> InvokeAsync(GetDbfsFileArgs args, InvokeOptions? opts = null)
        public static Output<GetDbfsFileResult> Invoke(GetDbfsFileInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDbfsFileResult> getDbfsFile(GetDbfsFileArgs args, InvokeOptions options)
    public static Output<GetDbfsFileResult> getDbfsFile(GetDbfsFileArgs args, InvokeOptions options)
    
    fn::invoke:
      function: databricks:index/getDbfsFile:getDbfsFile
      arguments:
        # arguments dictionary

    The following arguments are supported:

    LimitFileSize bool
    Do not load content for files larger than 4MB.
    Path string
    Path on DBFS for the file from which to get content.
    ProviderConfig GetDbfsFileProviderConfig
    Configure the provider for management through account provider. This block consists of the following fields:
    LimitFileSize bool
    Do not load content for files larger than 4MB.
    Path string
    Path on DBFS for the file from which to get content.
    ProviderConfig GetDbfsFileProviderConfig
    Configure the provider for management through account provider. This block consists of the following fields:
    limitFileSize Boolean
    Do not load content for files larger than 4MB.
    path String
    Path on DBFS for the file from which to get content.
    providerConfig GetDbfsFileProviderConfig
    Configure the provider for management through account provider. This block consists of the following fields:
    limitFileSize boolean
    Do not load content for files larger than 4MB.
    path string
    Path on DBFS for the file from which to get content.
    providerConfig GetDbfsFileProviderConfig
    Configure the provider for management through account provider. This block consists of the following fields:
    limit_file_size bool
    Do not load content for files larger than 4MB.
    path str
    Path on DBFS for the file from which to get content.
    provider_config GetDbfsFileProviderConfig
    Configure the provider for management through account provider. This block consists of the following fields:
    limitFileSize Boolean
    Do not load content for files larger than 4MB.
    path String
    Path on DBFS for the file from which to get content.
    providerConfig Property Map
    Configure the provider for management through account provider. This block consists of the following fields:

    getDbfsFile Result

    The following output properties are available:

    Content string
    base64-encoded file contents
    FileSize int
    size of the file in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitFileSize bool
    Path string
    ProviderConfig GetDbfsFileProviderConfig
    Content string
    base64-encoded file contents
    FileSize int
    size of the file in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitFileSize bool
    Path string
    ProviderConfig GetDbfsFileProviderConfig
    content String
    base64-encoded file contents
    fileSize Integer
    size of the file in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    limitFileSize Boolean
    path String
    providerConfig GetDbfsFileProviderConfig
    content string
    base64-encoded file contents
    fileSize number
    size of the file in bytes
    id string
    The provider-assigned unique ID for this managed resource.
    limitFileSize boolean
    path string
    providerConfig GetDbfsFileProviderConfig
    content str
    base64-encoded file contents
    file_size int
    size of the file in bytes
    id str
    The provider-assigned unique ID for this managed resource.
    limit_file_size bool
    path str
    provider_config GetDbfsFileProviderConfig
    content String
    base64-encoded file contents
    fileSize Number
    size of the file in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    limitFileSize Boolean
    path String
    providerConfig Property Map

    Supporting Types

    GetDbfsFileProviderConfig

    WorkspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    WorkspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId String
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspace_id str
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId String
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.

    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.85.0 published on Friday, Feb 13, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate