Condividi tramite


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.

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);
abstract member StageBlockAsync : string * System.IO.Stream * Azure.Storage.Blobs.Models.BlockBlobStageBlockOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>>
override this.StageBlockAsync : string * System.IO.Stream * Azure.Storage.Blobs.Models.BlockBlobStageBlockOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>>
Public Overridable Function StageBlockAsync (base64BlockId As String, content As Stream, Optional options As BlockBlobStageBlockOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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 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