BlockBlobClient.StageBlock(String, Stream, Byte[], BlobRequestConditions, IProgress<Int64>, CancellationToken) Method

Definition

The StageBlock(String, Stream, Byte[], BlobRequestConditions, IProgress<Int64>, CancellationToken) operation creates a new block as part of a block blob's "staging area" to be eventually committed via the CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation.

For more information, see Put Block.

public virtual Azure.Response<Azure.Storage.Blobs.Models.BlockInfo> StageBlock (string base64BlockId, System.IO.Stream content, byte[] transactionalContentHash = default, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = default, IProgress<long> progressHandler = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StageBlock : string * System.IO.Stream * byte[] * Azure.Storage.Blobs.Models.BlobRequestConditions * IProgress<int64> * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>
override this.StageBlock : string * System.IO.Stream * byte[] * Azure.Storage.Blobs.Models.BlobRequestConditions * IProgress<int64> * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>
Public Overridable Function StageBlock (base64BlockId As String, content As Stream, Optional transactionalContentHash As Byte() = Nothing, Optional conditions As BlobRequestConditions = Nothing, Optional progressHandler As IProgress(Of Long) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of BlockInfo)

Parameters

base64BlockId
String

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.

content
Stream

A Stream containing the content to upload.

transactionalContentHash
Byte[]

An optional MD5 hash of the block content. This hash is used to verify the integrity of the block during transport. When this value is specified, the storage service compares the hash of the content that has arrived with this value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation will throw a RequestFailedException.

conditions
BlobRequestConditions

Optional BlobRequestConditions to add conditions on the upload of this block.

progressHandler
IProgress<Int64>

Optional IProgress<T> to provide progress updates about data transfers.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<BlockInfo>

A Response<T> describing the state of the updated block.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to