コード例 #1
0
        public async Task TestBlobAttributesEncryptionAsync()
        {
            CloudBlobContainer container = GetRandomContainerReference();

            try
            {
                await container.CreateIfNotExistsAsync();

                CloudBlockBlob blob = container.GetBlockBlobReference(BlobTestBase.GetRandomContainerName());
                await blob.UploadTextAsync("test");

                await blob.FetchAttributesAsync();

                Assert.IsTrue(blob.Properties.IsServerEncrypted);

                CloudBlockBlob testBlob = container.GetBlockBlobReference(blob.Name);
                await testBlob.DownloadTextAsync();

                Assert.IsTrue(testBlob.Properties.IsServerEncrypted);
            }
            finally
            {
                container.DeleteIfExistsAsync().Wait();
            }
        }