amhed
amhed

Reputation: 3659

Shared Umbraco Media Folder on Azure Cloud Instances

I have just implemented Umbraco in an Azure Cloud Instance. I was able to migrate my existing SQL Database to run on SQL Azure and everything runs fine, except for the images and documents inside the media folder.

By default the media folder resides in [siteroot]/Media.

Is there a way to map this folder to azure storage? If not I don't think I'm going to be able to scale up my cloud instances, since the images depend on the virtual server's local storage.

Edit: Bounty Started

What I have so far is this:

I've seen a similar approach taken with the Azure Accelerator project from Umbraco here: http://azureaccelerators.codeplex.com/releases

But they haven't updated the release since 2011, and I'm not sure it would work with the current version of Azure.

Edit 2:

Umbraco has their own accelerator, but they've deprecated it in favor of using Websites instead of Web Roles: https://github.com/Microsoft-DPE/wa-accelerator-umbraco

This release works with the 1.6 SDK. Current version is 1.8 I believe...

Upvotes: 2

Views: 2242

Answers (4)

This package provided by Ali Sheikh Taheri solves the problem of the media folder http://our.umbraco.org/projects/backoffice-extensions/ast-azure-media-sync

Upvotes: 0

amhed
amhed

Reputation: 3659

Ended up using Matt Brailsford's Universal Media Picker solution: http://our.umbraco.org/projects/backoffice-extensions/universal-media-picker

The final solution actually circumvents the Umbraco Media Folder and reads directly from Blob Storage, so I had to rewrite all the macros and templates that rendered images before and point them directly to the Blob Storage account

Upvotes: 2

Digbyswift
Digbyswift

Reputation: 10400

I'm not sure about a way of mapping the path to storage, but depending on the version of Umbraco you are using, I think from 4.9 (possibly 4.10) they introduced FileSystemProviders configuration which may help solve your problem.

My understanding of it is that it allows you to replace the default Umbraco FileSystemProvider, Umbraco.Core.IO.PhysicalFileSystem with your own custom implementation. I'm pretty sure you could implement an Azure-based provider that wrote and read from the blob storage. In the source, it looks fairly straightforward, a matter of implementing their IFileSystem.

Upvotes: 2

Nico
Nico

Reputation: 2110

Unfortunately theres no way to map a NTFS directory to BlobStorage directly.

Have a look at the CloudDrive class of the Windows Azure SDK. This feature allows you to upload a Virtual Hard Disk file (.vhd file) into your blob storage and mount it as a local drive inside Windows Azure Instances.

You sould know that (if you're using multiple instances) only one cloud instance can mount the VHD in read/write mode. The rest of them has only read access to the drive. If the "Media" folder stores static content that you update manually only a few times, this is okay. But if user content is placed there, too, you might want only one instance to mount the VHD and grant other instances access to it via Network Share.

Upvotes: 1

Related Questions