BlockBlobClient.StageBlockFromUri(Uri, String, HttpRange, Byte[], RequestConditions, BlobRequestConditions, CancellationToken) Method

Definition

The StageBlockFromUri(Uri, String, HttpRange, Byte[], RequestConditions, BlobRequestConditions, CancellationToken) operation creates a new block to be committed as part of a blob where the contents are read from the sourceUri.

For more information, see Put Block From URL.

public virtual Azure.Response<Azure.Storage.Blobs.Models.BlockInfo> StageBlockFromUri (Uri sourceUri, string base64BlockId, Azure.HttpRange sourceRange = default, byte[] sourceContentHash = default, Azure.RequestConditions sourceConditions = default, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StageBlockFromUri : Uri * string * Azure.HttpRange * byte[] * Azure.RequestConditions * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>
override this.StageBlockFromUri : Uri * string * Azure.HttpRange * byte[] * Azure.RequestConditions * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>
Public Overridable Function StageBlockFromUri (sourceUri As Uri, base64BlockId As String, Optional sourceRange As HttpRange = Nothing, Optional sourceContentHash As Byte() = Nothing, Optional sourceConditions As RequestConditions = Nothing, Optional conditions As BlobRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of BlockInfo)

Parameters

sourceUri
Uri

Specifies the Uri of the source blob. The value may be a URL of up to 2 KB in length that specifies a blob. The source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation.

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 base64BlockId parameter must be the same size for each block. Note that the Base64 string must be URL-encoded.

sourceRange
HttpRange

Optionally uploads only the bytes of the blob in the sourceUri in the specified range. If this is not specified, the entire source blob contents are uploaded as a single block.

sourceContentHash
Byte[]

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

sourceConditions
RequestConditions

Optional RequestConditions to add conditions on the copying of data from this source blob.

conditions
BlobRequestConditions

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

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 blob.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to