Reputation: 1894
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
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.
sudo apt-get install blobfuse
mkdir ~/mycontainer
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
Upvotes: 4
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
Blobfuse is stable, and is supported by Azure Storage
given that it is used within its limits documented here: https://github.com/Azure/azure-storage-fuse
Installation document here: https://github.com/Azure/azure-storage-fuse/wiki/1.-Installation
Simply use whatever linux distro package installer with to get the blobfuse, please refer to the installation link above: like in Ubuntu its simply: sudo apt-get install blobfuse fuse
Upvotes: 14
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
Reputation: 1230
There is a new feature that allows you to do this called Azure Files service:
Introducing Microsoft Azure File Service
Upvotes: 7
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