I am attempting to copy all the blobs to different storage:
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);
}
}
I am able to see the listing of blobs & copy method is being invoked targetBlob.StartCopyFromBlob(thisBlobUri);
However copy is not actually happening. Any Idea?
P.S. I am using Azure Storage SDK 4.3 & target storage is development storage.
EDIT 2:
For remote azure storage copy above code works fine.
However for Emulated storage I get 400 BadRequest error, when trying to create container: targetContainer.CreateIfNotExists();
My emulated storage version is 3.0, it seems there is conflict between azure SDK & emulator version.
Which version of storage client library works well with storage emulator 3.0?