Azure Files

Mount Azure Files file system to access shared network storage directly from Valohai executions.


Overview

Azure Files provides managed SMB storage that you can mount in Valohai executions. Use Azure Files to:

  • Access large datasets without downloading

  • Share preprocessed data across multiple executions

  • Cache intermediate results on fast shared storage

  • Process data in place and save versioned outputs

⚠️ Important: Files in file share mounts are NOT versioned by Valohai. Always save final results to /valohai/outputs/ for reproducibility.


Prerequisites

Before mounting Azure Files storage in Valohai:

  1. Existing Azure Files instance — Use an existing storage or create a new one in Azure

  2. Network access — Make sure the Azure Files storage is accessible from your worker instances


Setup: Configure Azure Files Access

Step 1: Get the Azure Files storage information

  1. Navigate to your Azure storage account that contains the file share

  2. Under the Overview page for the file share, click on Connect and then navigate under the Linux tab.

  3. Take note of the following values:

    1. File share connection string, e.g. //storage-account-name.file.core.windows.net/file-share-name

    2. username, should match the storage account name

    3. password

Step 2: Store the file share information as environment variables

  1. In Valohai, navigate to projects Settings → Environment Variables

  2. Add the connection string, username and password as environment variables. Make sure to mark at least the password as a secret!

You can also save the values into an environment variable group to easily share them between several projects in Valohai.


Mount Azure Files file share in Execution

Mount Configuration

valohai.yaml:

Parameters:

  • destination — Mount point inside container (e.g., /mnt/fileshare-data)

  • source — File share connection string (format: //storage-account-name.file.core.windows.net/file-share-name), passed here from the FILE_SHARE environment variable

  • type — Depends on your file share type, either smb or cifs

  • username — Username for the file share, passed here from the USERNAME environment variable

  • password — Password for the file share, passed here from the PASSWORD environment variable

  • readonlytrue (recommended) or false

You can hardcode the connection string, username and password but especially for the latter tha is not recommended for security reasons.


Complete Workflow Example

Mount → Process → Save Pattern

Scenario: Process large video dataset stored on file share, extract features, save to Valohai outputs.

valohai.yaml:

extract_features.py:

Result:

  • ✅ Raw videos accessed from file share (no download time for 100GB+ videos)

  • ✅ Extracted features saved to /valohai/outputs/ (versioned)

  • ✅ Dataset created for reproducible model training

  • ✅ Can train on dataset://video-features/batch-001 anytime


Best Practices

Use Readonly for Input Data


Always Version Final Results


Organize Your File Share Structure

Clear organization makes mounting and access control easier.


Handle Mount Errors


Maintaining Reproducibility

⚠️ Critical: Azure Files file share data can change between executions. Always save processed results to /valohai/outputs/ for versioning.

The problem:

The solution:

See: Access Network Storage for complete patterns.



Next Steps

  • Set up Azure Files file share in your Azure resource group (or use existing)

  • Get file share information for connecting to it

  • Create test execution mounting the file share

  • Build pipeline: mount → process → save to outputs

  • Monitor file share performance in Azure console

Last updated

Was this helpful?