title: Azure File System - Can I "Watch" or only poll?
body: <p>I am an experienced windows C# developer, but new to the world of Azure, and so trying to figure out a "best practice" as I implement one or more Azure Cloud Services.</p>
  
  <p>I have a number of (external, and outside of my control) sources that can all save files to a folder (or possibly a set of folders). In the current state of my system under Windows, I have a FileSystemWatcher set up to monitor a folder and raise an event when a file appears there.</p>
  
  <p>In the world of Azure, what is the equivalent way to do this? Or is there?</p>
  
  <p>I am aware I could create a timer (or sleep) to pass some time (say 30 seconds), and poll the folder, but I'm just not sure that's the "best" way in a cloud environment.</p>
  
  <p>It is important to note that I have no control over the inputs - in other words the files are saved by an external device over which I have no control; so I can't, for example, push a message onto a queue when the file is saved, and respond to that message...</p>
  
  <p>Although, in the end, that's the goal...  So I intend to have a "Watcher" service which will (via events or polling) detect the presence of one or more files, and push a message onto the appropriate queue for the next step in my workflow to respond to.</p>
  
  <p>It should be noted that I am using VS2015, and the latest Azure SDK stuff, so I'm not limited by anything legacy.</p>
  
  <p>What I have so far is basically this (a snippet of a larger code base):</p>
  
  <pre><code>storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
  
  // Create a CloudFileClient object for credentialed access to File storage.
  fileClient = storageAccount.CreateCloudFileClient();
  
  // Obtain the file share name from the config file
  string sharenameString = CloudConfigurationManager.GetSetting("NLRB.Scanning.FileSharename");
  
  // Get a reference to the file share.
  share = fileClient.GetShareReference(sharenameString);
  
  // Ensure that the share exists.
  if (share.Exists())
  {
      Trace.WriteLine("Share exists.");
      // Get a reference to the root directory for the share.
      rootDir = share.GetRootDirectoryReference();
  
      //Here is where I want to start watching the folder represented by rootDir...
  }
  </code></pre>
  
  <p>Thanks in advance.</p>