Am using TransferManager to copy blobs from one container to another.
CloudStorageAccount sourceStorageAccount = CloudStorageAccount.Parse(@"source storage account connection string");
CloudStorageAccount destStorageAccount = CloudStorageAccount.Parse(@"destination storage account connection string");
CloudBlobClient sourceBlobClient = sourceStorageAccount.CreateCloudBlobClient();
CloudBlobClient destBlobClient = destStorageAccount.CreateCloudBlobClient();
var sourceContainer = sourceBlobClient.GetContainerReference("sourceContainer");
var destContainer = destBlobClient.GetContainerReference("destContainer");
CloudBlockBlob sourceBlob = sourceContainer.GetBlockBlobReference("copy.txt");
CloudBlockBlob targetBlob = destContainer.GetBlockBlobReference("copy.txt");
TransferManager.CopyAsync(sourceBlob, targetBlob, true).Wait();
But when the file exists in destination it throws error stating
"Skiped file \"https://sourceabcd.blob.core.windows.net/sourcecontainer/test1.txt\" because target \"https://sourceabcd.blob.core.windows.net/destcontainer/test1.txt\" already exists."} System.Exception {Microsoft.WindowsAzure.Storage.DataMovement.TransferSkippedException
Is there a option to overwrite the file if exists in destination ?