Question

Difficulty: EasyMove and Copy Blobs between Azure Storage Containers and Accounts

You are developing a .NET application using the Azure.Storage.Blobs SDK. You need to copy a blob from a source URI to a destination container using the following code:

csharp
// destinationClient is a BlobClient pointing to the target blob path
// sourceUri is the Uri of the source blob
await destinationClient._______(sourceUri);

Which method should you use to fill the blank to initiate the copy operation asynchronously?

  1. A
    UploadAsync
  2. StartCopyFromUriAsyncAnswer
  3. C
    AcquireLeaseAsync
  4. D
    GetPropertiesAsync

Answer

StartCopyFromUriAsync is the correct method to asynchronously copy a blob from a source URI.
The method StartCopyFromUriAsync is correct because it is the standard method in the Azure.Storage.Blobs SDK (BlobClient class) designed to start copy operations from a source URI asynchronously.

Step-by-Step Solution

1
Identify the requirement to copy an existing blob to a target destination using a URI in the .NET SDK.
The target object is a destination BlobClient.
The destination BlobClient is responsible for initiating the copy operation from the source URI.
2
Select the appropriate method from BlobClient that initiates a copy from a source URI.
The correct method is StartCopyFromUriAsync.
This method tells the Azure Storage service to start copying the blob data from the source URI asynchronously.

Key Concept

Asynchronous blob copying using the Azure.Storage.Blobs .NET SDK
Estimated Time:45s
Rate this question