none
How do i determine that azure blob copy is done

All replies

  • Hello,

    You can know this by running the following command

    $blobCopy | Get-AzureStorageBlobCopyState  

    where 

    $blobCopy = Start-AzureStorageBlobCopy -DestContainer $destinationContainerName -DestContext $destinationContext   -SrcBlob $blobName  -Context $sourceContext  - SrcContainer $sourceContainer

    Please check Step 7 in my article at http://social.technet.microsoft.com/wiki/contents/articles/34040.azure-migrating-vms.aspx

    Thanks

    Kailas

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

    Please Vote or Mark as Answer if found useful


    Friday, August 19, 2016 7:24 AM
  • Thanks for the reply.

    I want to do this using C# not using power shell.

    Friday, August 19, 2016 7:28 AM
  • Try this code in that case - 

    double bytesCopied = 0;

        if (backupBlob.CopyState.BytesCopied.HasValue)
            bytesCopied = backupBlob.CopyState.BytesCopied.Value;

        var totalBytes = backupBlob.CopyState.TotalBytes;

        if (totalBytes.HasValue)
        {
            Console.WriteLine("\t{0}/{1} bytes copied",
                              (bytesCopied)
                              .ToString(CultureInfo.InvariantCulture),
                              totalBytes.Value.ToString());
            Console.WriteLine("\tProgress : {0} %",
                              (bytesCopied / totalBytes.Value) * 100);
        }

    Thanks,

    Kailas

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

    Please Vote or Mark as Answer if found useful

    Friday, August 19, 2016 7:46 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:22 AM