Your development team is implementing a data migration service using the Azure.Storage.Blobs SDK (version 12.x) to migrate large media files from a source container in storage account 'mediaflowsource' to a destination container in storage account 'mediaflowdest' across different Azure regions. The destination blobs are locked with active leases to prevent accidental deletion during the process, and you must overwrite them with the new versions while preserving all user-defined metadata. The source blobs are private, and access must be granted using a Shared Access Signature (SAS) token.
Which of the following actions are required to complete this copy operation successfully? (Select TWO)
- Generate a Shared Access Signature (SAS) token for the source blob containing the Read permission, and append this token to the source URI passed to the copy operation.Answer
- Instantiate a BlobLeaseClient for the destination blob, and provide the active lease ID in the BlobCopyFromUriOptions.DestinationConditions.LeaseId property.Answer
- CGenerate a SAS token for the source blob with Read and Write permissions, and assign it to the BlobCopyFromUriOptions.SourceConditions.LeaseId property.
- DAdd custom metadata to the BlobCopyFromUriOptions.Metadata dictionary, prefixing each key with 'x-ms-meta-' to prevent metadata loss.
Answer
Generating a Shared Access Signature (SAS) token with Read permission and appending it to the source URI, along with providing the destination blob's active lease ID in the BlobCopyFromUriOptions.DestinationConditions.LeaseId property, are required to successfully complete the copy operation.
To copy a private source blob to a leased destination blob, the Azure Storage copy engine needs Read access to the source blob (provided via a SAS token with Read permission appended to the source URI), and the write request to the destination blob must include the active lease ID in the destination conditions (BlobCopyFromUriOptions.DestinationConditions.LeaseId) to authorize the overwrite.
Step-by-Step Solution
Key Concept
Asynchronous blob copying between storage accounts with source SAS authorization and destination lease handling using the .NET Azure.Storage.Blobs SDK.