Is their any any to convert from Append Blob to Block Blob .
Regards C
Is their any any to convert from Append Blob to Block Blob .
Once the blob has been created, its type cannot be changed, and it can be updated only by using operations appropriate for that blob type, i.e., writing a block or list of blocks to a block blob, appending blocks to a append blob, and writing pages to a page blob.
More information please refer to this link: Understanding Block Blobs, Append Blobs, and Page Blobs
Given: i have source blob which is append blob
And: i have to copy source to new blob container as block blob
When: i use CopyBlobToBlobckBlobContainer function
Then: destination container will have same blob as source but as block blob.
public void CopyBlobToBlobckBlobContainer(string sourceBlobName)
{
var sourceContainerClient = new BlobContainerClient(sourceConnectionString, BlobContainerName);
var destinationContainerClient = new BlobContainerClient(destinationConnectionString, OutBlobContainerName);
destinationContainerClient.CreateIfNotExists();
var sourceBlobClient = sourceContainerClient.GetBlockBlobClient(sourceBlobName);
var sourceUri = sourceBlobClient.GenerateSasUri(BlobSasPermissions.Read, ExpiryOffset);
var destBlobClient = destinationContainerClient.GetBlockBlobClient(sourceBlobName);
var result = destBlobClient.SyncUploadFromUri(sourceUri, overwrite: true);
var response = result.GetRawResponse();
if (response.Status != 201) throw new BlobCopyException(response.ReasonPhrase);
}