Mount a Blob Storage as Drive on VM
Asked Answered
C

5

15

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.

Christabelle answered 18/11, 2014 at 10:56 Comment(0)
A
7

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.

Apia answered 18/11, 2014 at 17:46 Comment(0)
B
14

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

Baroda answered 5/1, 2019 at 0:38 Comment(0)
A
7

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.

Apia answered 18/11, 2014 at 17:46 Comment(0)
E
7

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

Introducing Microsoft Azure File Service

Ensure answered 18/5, 2015 at 7:44 Comment(0)
I
4

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
Illuminate answered 17/6, 2019 at 14:30 Comment(2)
A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.Hufford
Done, was a bit hasty ;-)Illuminate
J
2

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.

Jonell answered 18/11, 2014 at 18:46 Comment(1)
The problem is that I need to create a Web Service(WCF) that accept large files, the program does manipulation on the files and then return the "new" files. I want to use storage for uploads client file to the Web Service and to give back to the client a link to the "new" file. So there isn't a way to get the files? You think that file service could provide the answer?Christabelle

© 2022 - 2024 — McMap. All rights reserved.