4
votes

As the title says, I'm looking for a way to access an azure files share (in preview) directly from an azure website. I cannot use any REST API or anything like this and I was looking for the possibility of mounting a SMB share directly into the website (through the new portal or any other way).

I found the following links, from which I understand that this is still under review (http://feedback.azure.com/forums/169385-web-apps-formerly-websites/suggestions/6084609-allow-map-azure-file-share-microsoft-azure-file-s) and also a SO question (Can the new Azure File Service be used from Azure WebSites?) that doesn't answer my question.

To be honest and for the sake of giving more details, my scenario is pretty simple - I have some websites and also some virtual machines that should access the files from the azure files service. Regarding the VM, the approach is pretty straight forward and easy but regarding the WebSites, I don't find any way at this moment.

On the other hand, regardless of the answer to the above question, does it make sense to (or do I have the possibility to) enable CDN over an Azure Files Share?

Thank you very much.

1
Using Azure Files REST API works from everywhere. Why you cannot use it?Sascha Gottfried
Why you do not consider Azure Blob Storage for file storage?Sascha Gottfried
I advice you to use Blob storage. You can use azure CDN with custom domain associate with it and you can manage all contents without any REST API as you want (via visual studio). How use CDN with Blob & custom domainEnrico Tirotta
1) Can't use Blob Storage because I have applications on the VMs that needs to access the files directly (SMB); 2) Can't use the Files Rest API because I need a way to access a file by an URL or something simillar (eg: image in a page). Thanks.Edi
" I need a way to access a file by an URL" . Excuse me, perhaps I do not understand your needs but you can access to a blob file by an url : http://<StorageAcountLabel>.blob.core.windows.net/<mycontainer>/<blob>Enrico Tirotta

1 Answers

6
votes

As of today, no single technology will serve your purpose. You can't use File Service as you don't have the capability to mount a share in an Azure Website as well as it is not suited for streaming purposes (all access to files there need to be authorized and there's no concept of Shared Access Signature in File Service today).

I guess, you would have to pick one of the two technologies (Blob Service and File Service) and make some compromises to make it work in both Websites and Virtual Machines.

Assuming you go with File Service, then you can mount them in the Virtual Machine and do the processing on the files there. On the website front, you would need to use Storage Client library to download the relevant files in some folder in your website and stream those files from there.

Assuming you go with Blob Service, then you can simply stream them in your website directly from blob storage (no need to have those files in your website). In the Virtual Machine, when you need to process those files (blobs), you would simply download them to your VM for processing and then re-upload them in blob storage.

Does it make sense to (or do I have the possibility to) enable CDN over an Azure Files Share?

Currently it is not possible to serve Azure File Service files via CDN.