In Azure, Where should I store physical files that need to be accessed by a Worker Role?

azure, azure-storage, azure-web-roles, azure-worker-roles

Solution

If you place your files in Windows Azure Storage (blobs are good for file storage), any of your role instances can access them, whether in Web Roles or Worker Roles. Also, Blob storage is durable meaning triple-replicated within the data center (and geo-replicated to another data center).

Regarding Worker Role instances not being able to access folders in a Web Role instance (or another Worker Role's instances), you're right. In fact, multiple instances of the same Role cannot access each other's file system (just remember that a Role is just Windows 2012 Server, and each instance of that Role runs in its own VM with its own local disks).

EDIT JULY 5 2014 This answer is now a bit old. Azure now offers a File Service, providing SMB shares which are backed by blob storage. This tends to be easier to work with for legacy applications that must use a file system and cannot be altered to directly read from / write to blobs. More information may be found here.

Problem

In Azure, Where should I store physical files that need to be accessed by a Worker Role? In my case I would normally store these particular files in my Web Role's App_Data folder but I don't believe that Worker Roles can access that folder.

Original source