public async Task CloudBlockBlobCopyFromSnapshotTestAsync() { CloudBlobContainer container = GetRandomContainerReference(); try { await container.CreateAsync(); CloudBlockBlob source = container.GetBlockBlobReference("source"); string data = "String data"; await UploadTextAsync(source, data, Encoding.UTF8); source.Metadata["Test"] = "value"; await source.SetMetadataAsync(); CloudBlockBlob snapshot = await source.CreateSnapshotAsync(); //Modify source string newData = "Hello"; source.Metadata["Test"] = "newvalue"; await source.SetMetadataAsync(); source.Properties.ContentMD5 = null; await UploadTextAsync(source, newData, Encoding.UTF8); Assert.AreEqual(newData, await DownloadTextAsync(source, Encoding.UTF8), "Source is modified correctly"); Assert.AreEqual(data, await DownloadTextAsync(snapshot, Encoding.UTF8), "Modifying source blob should not modify snapshot"); await source.FetchAttributesAsync(); await snapshot.FetchAttributesAsync(); Assert.AreNotEqual(source.Metadata["Test"], snapshot.Metadata["Test"], "Source and snapshot metadata should be independent"); CloudBlockBlob copy = container.GetBlockBlobReference("copy"); await copy.StartCopyAsync(TestHelper.Defiddler(snapshot)); await WaitForCopyAsync(copy); Assert.AreEqual(CopyStatus.Success, copy.CopyState.Status); Assert.AreEqual(data, await DownloadTextAsync(copy, Encoding.UTF8), "Data inside copy of blob not similar"); await copy.FetchAttributesAsync(); BlobProperties prop1 = copy.Properties; BlobProperties prop2 = snapshot.Properties; Assert.AreEqual(prop1.CacheControl, prop2.CacheControl); Assert.AreEqual(prop1.ContentEncoding, prop2.ContentEncoding); Assert.AreEqual(prop1.ContentDisposition, prop2.ContentDisposition); Assert.AreEqual(prop1.ContentLanguage, prop2.ContentLanguage); Assert.AreEqual(prop1.ContentMD5, prop2.ContentMD5); Assert.AreEqual(prop1.ContentType, prop2.ContentType); Assert.AreEqual("value", copy.Metadata["Test"], false, "Copied metadata not same"); await copy.DeleteAsync(); } finally { await container.DeleteAsync(); } }