title: Download Files from Azure Batch
body: <p>I would like to download the files after the task is complete. 
  How can I do it efficiently?</p>
  
  <p>Unfortunately, <em>task.EnvironmentSettings</em> is null and the following code snipet does not work (see the Microsoft <a href="https://azure.microsoft.com/en-us/documentation/articles/batch-api-basics/" rel="nofollow">instructions</a>).</p>
  
  <pre><code>IList&lt;environmentsetting&gt; listEnv = task.EnvironmentSettings;
  
  var envList = listEnv.Where(x =&gt; x.Name == "AZ_BATCH_TASK_WORKING_DIR").ToList();
  </code></pre>
  
  <p>also </p>
  
  <pre><code>var fileList = task.FilesToStage 
  </code></pre>
  
  <p>trigerrs the error:
  <em>The property FilesToStage cannot be read while the object is in the Bound state.</em></p>