2021年4月6日星期二

CloudBlob.CopyState is null after direct account-to-account copy completes

We're making use of direct account to account copying to transfer a set of blobs. Because properties are overwritten when the process starts we monitor the destination blobs on an interval then set properties when the copy is complete. For the most part this process works fine.

However, for just a couple of these blobs, there is no copy state on the destination blob (CloudBlob.CopyState is null). These blobs do not exist before hand, they're created as a result of calling CloudBlob.StartCopyAsync().

Here is some simplified code to outline how it works.

// Start copy operation  var operationId = await destinationBlob.StartCopyAsync(new Uri(sourceBlobUrlWithSas));    ...    // In a separate process, check the status after a delay, then repeat on an interval  if (destinationBlob.CopyState.Status == CopyStatus.Success) // <-- CopyState is null  {      // Set properties  }  

Microsoft docs indicate CopyState will be null when there is no copy state, but don't outline when that is. From my own experimentation, the destination blob seems to be created immediately, and the copy state seems remain on the blob for some time after an copy operation completes. When the issue occurs it's only a few minutes between starting the copy and checking the CopyState.

What could be the issue? Are there alternate methods of setting properties on the destination blob?

https://stackoverflow.com/questions/66964087/cloudblob-copystate-is-null-after-direct-account-to-account-copy-completes April 06, 2021 at 03:03PM

没有评论:

发表评论