Sdílet prostřednictvím


CloudBlockBlob.OpenWriteAsync Method

Definition

Overloads

OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

OpenWriteAsync()

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

OpenWriteAsync(CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
override this.OpenWriteAsync : Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
Public Overridable Function OpenWriteAsync (accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext) As Task(Of CloudBlobStream)

Parameters

accessCondition
AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options
BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

Returns

A Task<TResult> object of type CloudBlobStream that represents the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the block size to write, in bytes, ranging from between 16 KB and 100 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, pass in an AccessCondition object generated using GenerateIfNotExistsCondition().

Applies to

OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
override this.OpenWriteAsync : Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
Public Overridable Function OpenWriteAsync (accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task(Of CloudBlobStream)

Parameters

accessCondition
AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options
BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

A Task<TResult> object of type CloudBlobStream that represents the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the block size to write, in bytes, ranging from between 16 KB and 100 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, pass in an AccessCondition object generated using GenerateIfNotExistsCondition().

Applies to

OpenWriteAsync()

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync ();
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : unit -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
override this.OpenWriteAsync : unit -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
Public Overridable Function OpenWriteAsync () As Task(Of CloudBlobStream)

Returns

A Task<TResult> object of type CloudBlobStream that represents the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the block size to write, in bytes, ranging from between 16 KB and 100 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, see OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext).

Applies to

OpenWriteAsync(CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, it will be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
override this.OpenWriteAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream>
Public Overridable Function OpenWriteAsync (cancellationToken As CancellationToken) As Task(Of CloudBlobStream)

Parameters

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

A Task<TResult> object of type CloudBlobStream that represents the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the block size to write, in bytes, ranging from between 16 KB and 100 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, see OpenWriteAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken).

Applies to