title: Copying Blob in Azure Function with VS2017
body: <p>I'm using the latest Azure Function SDK in Visual Studio 2017, and I want to copy a blob from one container to another. The name stays the same, but the container name will be retrieved from the metadata of the source blob.</p>
  
  <p>I started of with just trying to trigger the function and include the metadata as:</p>
  
  <pre><code>    [FunctionName("ScanFile")]
      public static void Run([BlobTrigger("tobescanned/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, IDictionary&lt;string, string&gt; metadata, string name, TraceWriter log)
      {
          log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
          log.Info($"metadata count {metadata.Count}");
      } 
  </code></pre>
  
  <p>This works, so then tried to do the copy as:</p>
  
  <pre><code>    [FunctionName("ScanFile")]
      public static void Run([BlobTrigger("tobescanned/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, IDictionary&lt;string, string&gt; metadata, string name,
          [Blob("employees/{name}", Connection = "AzureWebJobsStorage")]Stream outputBlob,
          TraceWriter log)
      {
          log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
          log.Info($"metadata count {metadata.Count}");
  
          myBlob.CopyTo(outputBlob);
      }
  </code></pre>
  
  <p>But now the function isn't event called, so have done something wrong with the bindings. Is there anything obvious I've done wrong? I've found it difficult finding examples using the new Function SDK.</p>
  
  <p>The next step from this (when I've got it working) is to have the output container set at runtime. I thought it might be something like:</p>
  
  <pre><code>    [FunctionName("ScanFile")]
      public static void Run([BlobTrigger("tobescanned/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, IDictionary&lt;string, string&gt; metadata, string name,
          [Blob("{outputContainer}/{name}", Connection = "AzureWebJobsStorage")]Stream outputBlob, string outputContainer,
          TraceWriter log)
      {
          log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
          log.Info($"metadata count {metadata.Count}");
  
          outputContainer = metadata["Destination"];
  
          myBlob.CopyTo(outputBlob);
      }
  </code></pre>
  
  <p>Does this look like it would work (when I've got the output working)?</p>
  
  <p>Thanks</p>