Search code examples
azureazure-blob-storageblock

What is the maximum length for block Id when uploading new block to existing Azure BlockBlob


While dealing with Azure Blob Storage, there are meta data for each blob data, there is not a way to add meta data to each block.

In our case, there are some data we want to keep it separate from the actual block content, but still attached to each block when created, so that while the entire blob content is at its original format, from the meta data of each block, we can track the history of each transmission for further telemetry.

Since there is no meta data property available when calling Microsoft.WindowsAzure.Storage.Blob.PutBlockAsync, the workaround we have thought of is to using the Json representation of the meta data as the block Id.

One concern is that, we don't know the maximum allowed length of the block id. my question is, is there a known limit of the length of the block id?

Please advise.


Solution

  • One concern is that, we don't know the maximum allowed length of the block id. my question is, is there a known limit of the length of the block id?

    Maximum length of a block id can be 64 bytes. Please note that block id must be bas64 encoded.

    From this link:

    A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size.

    For a given blob, the length of the value specified for the blockid parameter must be the same size for each block.

    Note that the Base64 string must be URL-encoded.