title: How to Copy Azure Containers & Blobs
body: <p>I am attempting to copy all the blobs to different storage:</p>
  
  <pre><code>CloudBlobClient srcblobClient = sourceStorageAccount.CreateCloudBlobClient();
  CloudBlobClient targetBlobClient = targetStorageAccount.CreateCloudBlobClient();
  
  foreach (CloudBlobContainer cont in srcblobClient.ListContainers())
  {
      foreach (IListBlobItem srcBlob in cont.ListBlobs(useFlatBlobListing: true))
      {                        
          var targetContainer = targetBlobClient.GetContainerReference(cont.Name);
          targetContainer.CreateIfNotExists();
  
          Uri thisBlobUri = srcBlob.Uri;
          var serverBlob = srcblobClient.GetBlobReferenceFromServer(thisBlobUri);
  
          ICloudBlob targetBlob = targetContainer.GetBlobReferenceFromServer(serverBlob.Name);
  
          targetBlob.StartCopyFromBlob(thisBlobUri);
      }
  }
  </code></pre>
  
  <p>I am able to see the listing of blobs &amp; copy method is being invoked <code>targetBlob.StartCopyFromBlob(thisBlobUri);</code></p>
  
  <p>However copy is not actually happening. Any Idea?</p>
  
  <p>P.S. I am using Azure Storage SDK 4.3 &amp; target storage is development storage.</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>For remote azure storage copy above code works fine. </p>
  
  <blockquote>
    <p>However for Emulated storage I get 400 BadRequest error, when trying to create container:
            targetContainer.CreateIfNotExists();</p>
  </blockquote>
  
  <p>My emulated storage version is 3.0, it seems there is conflict between azure SDK &amp; emulator version.</p>
  
  <blockquote>
    <p>Which version of storage client library works well with storage
    emulator 3.0?</p>
  </blockquote>