3
votes

Is their any any to convert from Append Blob to Block Blob .

Regards C

4

4 Answers

2
votes

For a blob conversion, I am using a

--blob-type=BlockBlob 

option at the end of my azcopy.exe statement. So far it works well.

Good luck!

1
votes

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

0
votes

Is their any any to convert from Append Blob to Block Blob .

Automatic conversion between blob types is not allowed. What you would need to do is download the blob and reupload it as Block Blob.

0
votes

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);
    }