Dela via


CloudPageBlob.OpenWriteAsync Method

Definition

Overloads

OpenWriteAsync(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

OpenWriteAsync(Nullable<Int64>, Nullable<PremiumPageBlobTier>, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

OpenWriteAsync(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

OpenWriteAsync(Nullable<Int64>)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

OpenWriteAsync(Nullable<Int64>, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

OpenWriteAsync(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (long? size, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Nullable<int64> * 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 : Nullable<int64> * 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 (size As Nullable(Of Long), accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext) As Task(Of CloudBlobStream)

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

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 page size to write, in multiples of 512 bytes, ranging from between 512 and 4 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(Nullable<Int64>, Nullable<PremiumPageBlobTier>, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (long? size, Microsoft.Azure.Storage.Blob.PremiumPageBlobTier? premiumPageBlobTier, 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 : Nullable<int64> * Nullable<Microsoft.Azure.Storage.Blob.PremiumPageBlobTier> * 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 : Nullable<int64> * Nullable<Microsoft.Azure.Storage.Blob.PremiumPageBlobTier> * 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 (size As Nullable(Of Long), premiumPageBlobTier As Nullable(Of PremiumPageBlobTier), accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task(Of CloudBlobStream)

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

premiumPageBlobTier
Nullable<PremiumPageBlobTier>

A PremiumPageBlobTier representing the tier to set.

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 page size to write, in multiples of 512 bytes, ranging from between 512 and 4 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(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.Blob.CloudBlobStream> OpenWriteAsync (long? size, 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 : Nullable<int64> * 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 : Nullable<int64> * 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 (size As Nullable(Of Long), accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task(Of CloudBlobStream)

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

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 page size to write, in multiples of 512 bytes, ranging from between 512 and 4 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(Nullable<Int64>)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

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

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

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 page size to write, in multiples of 512 bytes, ranging from between 512 and 4 MB inclusive.

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

Applies to

OpenWriteAsync(Nullable<Int64>, CancellationToken)

Initiates an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

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

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

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 page size to write, in multiples of 512 bytes, ranging from between 512 and 4 MB inclusive.

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

Applies to