Azure Machine Learning Compute Instance Data "Mount" option unavailable in studio

Sam Preston 0 Reputation points Microsoft Employee
2024-07-26T14:51:03.9866667+00:00

In the compute instance management interface there is a 'Data (preview)' tab that I've previously used to mount a datastore to a compute instance. In newly-created compute instances the Mount option is unavailable (see below). Are there requirements on the compute instance settings for this option to be available? I haven't been able to find any documentation on this preview feature. Is there a CLI method for creating these mounts?

User's image

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,729 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 13,801 Reputation points
    2024-07-27T11:58:12.88+00:00

    Hi Sam Preston,

    Thanks for reaching out to Microsoft Q&A.

    The below code snippet demonstrates how to mount a datastore in Azure Machine Learning using Python. The mount method creates a context that must be started to access the mounted files.

    from azureml.core import Workspace, Datastore, Dataset
    # Connect to the workspace
    workspace = Workspace.from_config()
    # Retrieve the datastore
    datastore = Datastore.get(workspace, 'your_datastore_name')
    # Create a dataset from the datastore
    dataset = Dataset.File.from_files((datastore, 'path/to/your/files'))
    # Mount the dataset
    mounted_path = '/mnt/mount_dir'
    mount_context = dataset.mount(mounted_path)
    # Start the mount context
    mount_context.start()
    # Use the mounted path for your operations
    # Stop the mount context when done
    mount_context.stop()
    

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    0 comments No comments