none
How to compare two Azure block blobs in c#

All replies

  • Hello,

    Please follow these steps: 

    using Microsoft.Azure;

    // Retrieve storage account from connection string.
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
        CloudConfigurationManager.GetSetting("StorageConnectionString"));

    // Create the blob client.
    CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

    // Retrieve reference to a previously created container.
    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer1");

    // Retrieve reference to a blob named "blob1.txt"
    CloudBlockBlob blockBlob1 = container.GetBlockBlobReference("blob1.txt");

    Once you get this, similarly get object for blob2. Then do a comparision using number of bytes (MemoryStream) 

    Thanks
    Kailas


    -----------------------------------------------------

    Pleae Vote or Mark as Answer if found useful

    Friday, August 19, 2016 7:43 AM
  • Hi ,

    Do you mind sharing the whole solution here and mark it as answer? It would make others who stuck with the similar issue easier to find a valid solution in this forum.

    Best regards,

    Kailas

    --------------------------------------------------------

    Please Vote or Mark as Answer if found useful

    Monday, August 22, 2016 8:23 AM