Created
February 1, 2019 02:30
-
-
Save donma/a6ee1a0ac347628fd90d6defb88caa3b to your computer and use it in GitHub Desktop.
Azure Blob Storage Get File Text Content
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 connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
//Create Container | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
Console.WriteLine("donmablogsample create already."); | |
//Get Dir | |
Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory cloudBlobDirectory = | |
cloudBlobContainer.GetDirectoryReference("TEST2/TEST21/"); | |
Console.WriteLine("Get File Content : TEST2/TEST21/sampleText9.json"); | |
//Download Text | |
var result = cloudBlobDirectory.GetBlockBlobReference("sampleText9.json").DownloadTextAsync().Result; | |
Console.WriteLine("TEST2/TEST21/sampleText9.json content =>" + result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment