title: How to download and read files from azure blob container
body: <p>I have a large number of files which are migrated from a premise database to azure blob.<br>
  what I want is to verify whether those files are successfully migrated or not.<br>
  Therefore I want to check all the files from azure blob.<br>
  With their name, size, ...<br>
  And if the size is &lt; 0 or if it is not downloaded, then I have to report that as corrupted.</p>
  
  <p>Can I read all files from azure?<br>
  And how can I check their size and whether they are downloaded or not?</p>
  
  <p>I have tried the code below:</p>
  
  <pre><code>private const string account = "romantest";
      private const string key = "bwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhfbwhf==";
      private const string url = "https://backup.blob.core.windows.net/";
      private const string containerName = "testcontainer";
      private const string blobName = "testblob";
  
  // get storage
          StorageCredentialsAccountAndKey creds = new StorageCredentialsAccountAndKey(account, key);
          CloudBlobClient blobStorage = new CloudBlobClient(url, creds);
  
          // get blob container
          CloudBlobContainer blobContainer = blobStorage.GetContainerReference(containerName);
  
          // get blob data
          CloudBlob cloudBlob = blobContainer.GetBlobReference(blobName);
          string text = cloudBlob.DownloadText();
  </code></pre>
  
  <p>But it's not giving the exact results.<br>
  Could you please help me?</p>
  
  <p>Or else we can compare its like:</p>
  
  <ul>
  <li>We will store all files from a premise database in Excel or collection.  </li>
  <li>Read them one by one  </li>
  <li>Ehen we read first then (at the same time) we can check in azure blob container whether the same file exists or not, and its size. Downloaded or not like that </li>
  </ul>
  
  <p>Please suggest me anything.</p>