BlockBlobClient.StageBlockAsync Method

Definition

The StageBlockAsync(String, Stream, BlockBlobStageBlockOptions, CancellationToken) operation creates a new block as part of a block blob's "staging area" to be eventually committed via the CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation.

For more information, see Put Block.

C#
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>> StageBlockAsync(string base64BlockId, System.IO.Stream content, Azure.Storage.Blobs.Models.BlockBlobStageBlockOptions options = default, System.Threading.CancellationToken cancellationToken = default);

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 will be URL-encoded.

content
Stream

A Stream containing the content to upload.

options
BlockBlobStageBlockOptions

Optional parameters.

cancellationToken
CancellationToken

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

Returns

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

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to

Product Versions
Azure SDK for .NET Latest, Preview