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?
Gets a reference to a block blob in this container.
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).
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With