Ron
Ron

Reputation: 1894

Mount a Blob Storage as Drive on VM

I need to somehow uploads files and access them on the VM, how can I do this?

Specifically, how can I get access to files I've uploaded as a blob from within the VM?

I tried to access a file that I've uploaded as a blob onto an Azure Virtual Machine, but I couldn't find it anywhere on VM.

Can I simply mount a blob storage as a drive on my VM?

I am trying to avoid the round trip time of getting it from the actual blob storage and downloading it to the VM.

Upvotes: 15

Views: 41577

Answers (5)

Florida Man
Florida Man

Reputation: 2147

Check this blog entry for a step by step guide. It explains how to mount a blob, connect your jupyter notebook (Azure notebook) to it and Run Keras flow_from_directory() with it.

The base concept is using blobfuse.

  • Install blobfuse on your DSVM with sudo apt-get install blobfuse
  • Create folder for blob on the DSVM with: mkdir ~/mycontainer
  • Mount blob into DSVM with:
sudo blobfuse ~/mycontainer — tmp-path=/mnt/resource/blobfusetmp — config-file=./fuse_connection.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other
  • Connect your Jupyter Notebook to the DSVM

  • Use Keras flow_from_directory() with the path pointing to the mounted blob

  • Save models into the same path via callback function

Upvotes: 4

Tats_innit
Tats_innit

Reputation: 34107

You can now mount azure blob to Linux Vms. Please note there is a Linux FUSE adapter for Azure storage now which is called Blobfuse. This is an old question but I thought it would be helpful to add a solution for accessing \ Mounting blobs in your Linux VMs using BlobFuse official docs here: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-how-to-mount-container-linux

Upvotes: 14

ryan1234
ryan1234

Reputation: 7275

You can't mount blob storage as a drive. If you have a VHD in blob storage you can mount that and attach it to a VM, but as far as I know you can't mount blob storage.

(The one potential exception is with Azure's HDFS implementation which runs on a Linux machine and uses blob storage as the backing store for HDFS.)

If you've uploaded a file to blob storage, you can simply use the Azure APIs to download the file.

Get started with Azure Blob storage using .NET : Download Blobs

There is an example on how to download the blob.

Upvotes: 7

Spencer Rose
Spencer Rose

Reputation: 1230

There is a new feature that allows you to do this called Azure Files service:

Introducing Microsoft Azure File Service

Upvotes: 7

Serdar Ozler
Serdar Ozler

Reputation: 3802

No, Azure Blob service does not provide that functionality. If your application requires mounting shares on a VM, I would recommend looking at Azure File service, which exposes file shares using the standard SMB 2.1 protocol.

Upvotes: 2

Related Questions