Created
June 9, 2014 16:37
-
-
Save Dillie-O/e657c875f6d498c86344 to your computer and use it in GitHub Desktop.
Read Text From Azure Blob Container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var storageConnection = CloudConfigurationManager.GetSetting("StorageConnectionString"); | |
| var containerName = CloudConfigurationManager.GetSetting("StorageContainerName"); | |
| var storageAccount = CloudStorageAccount.Parse(storageConnection); | |
| var blobClient = storageAccount.CreateCloudBlobClient(); | |
| var container = blobClient.GetContainerReference(containerName); | |
| var blobLog = container.GetBlockBlobReference(id); | |
| string logText; | |
| using (var memoryStream = new MemoryStream()) | |
| { | |
| blobLog.DownloadToStream(memoryStream); | |
| logText = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment