Skip to main content
file-container-cover

Overview

File Containers allows you to manage and store files. Each project has its own isolated file container. You can interact with file containers like AWS S3 buckets or Google Cloud Storage buckets. Also, Datazone provides toolkits to interact with file containers. You can use the FileContainerClient in notebooks and pipelines to interact with file containers.
  1. Click Projects in the left sidebar.
  2. Choose a project from the card list.
  3. Click File Containers tab in the left sidebar.
file-container

Client Usage

The FileContainerClient provides a convenient interface to interact with file containers using S3-compatible storage. It handles authentication and bucket management automatically.
The FileContainerClient is only available in the execution environment (pipelines and notebooks running on Datazone). For local development and external applications, see the Local Access section below.
You can access the FileContainerClient in your pipelines and notebooks like this:

list_objects

Lists objects in the file container with an optional prefix filter.
Parameters:
  • prefix (str): Optional prefix to filter objects by path
Returns:
  • list: List of object metadata dictionaries. Example:

get_object

Retrieves an object from the file container by its key.
Parameters:
  • key (str): The key/path of the object to retrieve
Returns:
  • bytes: The object’s raw data
Objects are stored as bytes, so you may need to encode/decode text data appropriately

put_object

Stores data in the file container at the specified key.
Parameters:
  • key (str): The key/path where the object will be stored
  • data (bytes): The data to store

delete_object

Removes an object from the file container.
Parameters:
  • key (str): The key/path of the object to delete

Examples

Periodically Uploading Files in a Pipeline

You can use the FileContainerClient to periodically upload files to your file container. This can be useful for tasks like logging, data collection, or backups.

Read a Parquet File in a Notebook

Local Access

For local development and external applications, you can access File Containers using S3-compatible tools and SDKs. This requires Access Keys for authentication.

Prerequisites

Before connecting locally, you need:
  1. Access Keys - Create from your project settings (Learn how)
  2. Endpoint URL - Your Datazone instance URL (e.g., your-instance.datazone.co:3333)
  3. Project Path - Format: {project-name}/main/file-container/

AWS CLI

Install AWS CLI

Configure Credentials

Set your access keys as environment variables:

List Files

Upload a File

Download a File

Sync Directory

Python (boto3)

Install boto3

Configure S3 Client

List Files

Upload a File

Download a File

Upload with Metadata

JavaScript (AWS SDK)

Install AWS SDK

Configure S3 Client

List Files

Upload a File

Download a File

Java (AWS SDK)

Add Dependency

Configure S3 Client

List Files

Upload a File

Download a File

Common Operations

Check if File Exists

Python:

Delete a File

AWS CLI:
Python:

Get File Metadata

Python:

Best Practices

  1. Use Environment Variables - Never hardcode credentials in code
  2. Handle Errors - Always wrap operations in try-catch blocks
  3. Stream Large Files - Use streaming uploads/downloads for large files
  4. Set Timeouts - Configure appropriate timeouts for your use case
  5. Clean Up - Delete temporary files after processing
  6. Monitor Usage - Track file operations for cost management

Next Steps