Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does CloudBlockBlob.StartCopyAsync return when the copy is completed?

There are several ways to copy azure blob storage blocks around. There's a synchronous and asynchronous version of StartCopy. There is also a BeginStartCopy which also has the completion callback.

The BeginStartCopy approach explicitly states that the callback is executed when the copy has completed.

The StartCopy approaches both state that they return a string, which is a copy process id - they don't state that they return when the copy has completed.

Do those StartCopy methods return after the actual copy has completed?

like image 633
Ryan Avatar asked Sep 25 '18 17:09

Ryan


People also ask

What happens when you call Getblockblobreference with the name of a blob?

Gets a reference to a block blob in this container.

How do I copy a container from one storage to another?

Copy a container to another storage account by using the azcopy copy command. This example encloses path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe).

What is a CloudBlockBlob?

CloudBlockBlob(final StorageUri blobAbsoluteUri) Creates an instance of the class using the specified absolute StorageUri. CloudBlockBlob(final StorageUri blobAbsoluteUri, final StorageCredentials credentials) Creates an instance of the class using the specified absolute StorageUri and credentials.


1 Answers

Both StartCopy() and await StartCopyAsync() return when the copy is started on Azure Blob Storage service. The completion callback of BeginStartCopy() is also executed when the copy is started on Azure Blob Storage service.

In conclusion, StartCopy (including all 3 versions above) is an asynchronous API, you need to call FetchAttributes() periodically by yourself to get the latest copy progress.

Here is an answer that you can refer to: https://stackoverflow.com/a/47651946/2995449

like image 181
Zhaoxing Lu Avatar answered Nov 12 '22 18:11

Zhaoxing Lu