Class CloudBlob
- Namespace
- Microsoft.WindowsAzure.Storage.Blob
- Assembly
- Microsoft.WindowsAzure.Storage.dll
Represents an Azure blob. A blob stores text or binary data, such as documents or media files.
public class CloudBlob : IListBlobItem
- Inheritance
-
CloudBlob
- Implements
- Derived
- Inherited Members
Constructors
CloudBlob(StorageUri, DateTimeOffset?, StorageCredentials)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(StorageUri blobAbsoluteUri, DateTimeOffset? snapshotTime, StorageCredentials credentials)
Parameters
blobAbsoluteUri
StorageUriA StorageUri containing the absolute URI to the blob at both the primary and secondary locations.
snapshotTime
DateTimeOffset?A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
credentials
StorageCredentialsA StorageCredentials object.
CloudBlob(StorageUri, DateTimeOffset?, CloudBlobClient)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(StorageUri blobAbsoluteUri, DateTimeOffset? snapshotTime, CloudBlobClient client)
Parameters
blobAbsoluteUri
StorageUriA StorageUri containing the absolute URI to the blob at both the primary and secondary locations.
snapshotTime
DateTimeOffset?A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
client
CloudBlobClientA CloudBlobClient object.
CloudBlob(Uri)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(Uri blobAbsoluteUri)
Parameters
blobAbsoluteUri
UriA System.Uri specifying the absolute URI to the blob.
CloudBlob(Uri, StorageCredentials)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(Uri blobAbsoluteUri, StorageCredentials credentials)
Parameters
blobAbsoluteUri
UriA System.Uri specifying the absolute URI to the blob.
credentials
StorageCredentialsA StorageCredentials object.
CloudBlob(Uri, CloudBlobClient)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(Uri blobAbsoluteUri, CloudBlobClient client)
Parameters
blobAbsoluteUri
UriA System.Uri specifying the absolute URI to the blob.
client
CloudBlobClientA CloudBlobClient object.
CloudBlob(Uri, DateTimeOffset?, StorageCredentials)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(Uri blobAbsoluteUri, DateTimeOffset? snapshotTime, StorageCredentials credentials)
Parameters
blobAbsoluteUri
UriA System.Uri specifying the absolute URI to the blob.
snapshotTime
DateTimeOffset?A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
credentials
StorageCredentialsA StorageCredentials object.
CloudBlob(Uri, DateTimeOffset?, CloudBlobClient)
Initializes a new instance of the CloudBlob class using an absolute URI to the blob.
public CloudBlob(Uri blobAbsoluteUri, DateTimeOffset? snapshotTime, CloudBlobClient client)
Parameters
blobAbsoluteUri
UriA System.Uri specifying the absolute URI to the blob.
snapshotTime
DateTimeOffset?A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
client
CloudBlobClientA CloudBlobClient object.
Properties
BlobType
Gets the type of the blob.
public BlobType BlobType { get; }
Property Value
Container
Gets a CloudBlobContainer object representing the blob's container.
public CloudBlobContainer Container { get; }
Property Value
- CloudBlobContainer
A CloudBlobContainer object.
CopyState
Gets the state of the most recent or pending copy operation.
public CopyState CopyState { get; }
Property Value
- CopyState
A CopyState object containing the copy state, or
null
if there is no copy state for the blob.
IsDeleted
Gets a value indicating whether or not this blob has been deleted.
public bool IsDeleted { get; }
Property Value
- bool
A bool representing if the blob has been deleted.
IsSnapshot
Gets a value indicating whether this blob is a snapshot.
public bool IsSnapshot { get; }
Property Value
- bool
true
if this blob is a snapshot; otherwise,false
.
Metadata
Gets the user-defined metadata for the blob.
public IDictionary<string, string> Metadata { get; }
Property Value
- IDictionary<string, string>
An IDictionary<TKey, TValue> object containing the blob's metadata as a collection of name-value pairs.
Name
Gets the name of the blob.
public virtual string Name { get; }
Property Value
- string
A string containing the name of the blob.
Parent
Gets the CloudBlobDirectory object representing the virtual parent directory for the blob.
public CloudBlobDirectory Parent { get; }
Property Value
- CloudBlobDirectory
A CloudBlobDirectory object.
Properties
Gets the blob's system properties.
public BlobProperties Properties { get; }
Property Value
- BlobProperties
A BlobProperties object.
ServiceClient
Gets the CloudBlobClient object that represents the Blob service.
public CloudBlobClient ServiceClient { get; }
Property Value
- CloudBlobClient
A CloudBlobClient object.
SnapshotQualifiedStorageUri
Gets the blob's URI for both the primary and secondary locations, including query string information if the blob is a snapshot.
public StorageUri SnapshotQualifiedStorageUri { get; }
Property Value
- StorageUri
An object of type StorageUri containing the blob's URIs for both the primary and secondary locations, including snapshot query information if the blob is a snapshot.
SnapshotQualifiedUri
Gets the absolute URI to the blob, including query string information if the blob is a snapshot.
public Uri SnapshotQualifiedUri { get; }
Property Value
- Uri
A System.Uri specifying the absolute URI to the blob, including snapshot query information if the blob is a snapshot.
SnapshotTime
Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
public DateTimeOffset? SnapshotTime { get; }
Property Value
- DateTimeOffset?
A DateTimeOffset containing the blob's snapshot time if the blob is a snapshot; otherwise,
null
.
Remarks
If the blob is not a snapshot, the value of this property is null
.
StorageUri
Gets the blob's URIs for both the primary and secondary locations.
public StorageUri StorageUri { get; }
Property Value
- StorageUri
An object of type StorageUri containing the blob's URIs for both the primary and secondary locations.
StreamMinimumReadSizeInBytes
Gets or sets the minimum number of bytes to buffer when reading from a blob stream.
public int StreamMinimumReadSizeInBytes { get; set; }
Property Value
- int
The minimum number of bytes to buffer, being at least 16 KB.
Uri
Gets the blob's URI for the primary location.
public Uri Uri { get; }
Property Value
- Uri
A System.Uri specifying the absolute URI to the blob at the primary location.
Methods
AbortCopy(string, AccessCondition, BlobRequestOptions, OperationContext)
Aborts an ongoing blob copy operation.
[DoesServiceRequest]
public virtual void AbortCopy(string copyId, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
copyId
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
AbortCopyAsync(string)
Initiates an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId)
Parameters
copyId
stringA string identifying the copy operation.
Returns
AbortCopyAsync(string, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
copyId
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
AbortCopyAsync(string, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
copyId
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
AbortCopyAsync(string, CancellationToken)
Initiates an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, CancellationToken cancellationToken)
Parameters
copyId
stringA string identifying the copy operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
AcquireLease(TimeSpan?, string, AccessCondition, BlobRequestOptions, OperationContext)
Acquires a lease on this blob.
[DoesServiceRequest]
public virtual string AcquireLease(TimeSpan? leaseTime, string proposedLeaseId, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- string
The ID of the acquired lease.
AcquireLeaseAsync(TimeSpan?, string)
Initiates an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual Task<string> AcquireLeaseAsync(TimeSpan? leaseTime, string proposedLeaseId = null)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
AcquireLeaseAsync(TimeSpan?, string, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual Task<string> AcquireLeaseAsync(TimeSpan? leaseTime, string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
AcquireLeaseAsync(TimeSpan?, string, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual Task<string> AcquireLeaseAsync(TimeSpan? leaseTime, string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
AcquireLeaseAsync(TimeSpan?, string, CancellationToken)
Initiates an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual Task<string> AcquireLeaseAsync(TimeSpan? leaseTime, string proposedLeaseId, CancellationToken cancellationToken)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
BeginAbortCopy(string, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAbortCopy(string copyId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
copyId
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginAbortCopy(string, AsyncCallback, object)
Begins an asynchronous operation to abort an ongoing blob copy operation.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAbortCopy(string copyId, AsyncCallback callback, object state)
Parameters
copyId
stringA string identifying the copy operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginAcquireLease(TimeSpan?, string, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAcquireLease(TimeSpan? leaseTime, string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginAcquireLease(TimeSpan?, string, AsyncCallback, object)
Begins an asynchronous operation to acquire a lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAcquireLease(TimeSpan? leaseTime, string proposedLeaseId, AsyncCallback callback, object state)
Parameters
leaseTime
TimeSpan?A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If
null
, an infinite lease will be acquired. If not null, this must be 15 to 60 seconds.proposedLeaseId
stringA string representing the proposed lease ID for the new lease, or
null
if no lease ID is proposed.callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginBreakLease(TimeSpan?, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginBreakLease(TimeSpan? breakPeriod, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginBreakLease(TimeSpan?, AsyncCallback, object)
Begins an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginBreakLease(TimeSpan? breakPeriod, AsyncCallback callback, object state)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginChangeLease(string, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginChangeLease(string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginChangeLease(string, AccessCondition, AsyncCallback, object)
Begins an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginChangeLease(string proposedLeaseId, AccessCondition accessCondition, AsyncCallback callback, object state)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDelete(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDelete(AsyncCallback, object)
Begins an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDeleteIfExists(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous request to delete the blob if it already exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDeleteIfExists(AsyncCallback, object)
Begins an asynchronous request to delete the blob if it already exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadRangeToByteArray(byte[], int, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToByteArray(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadRangeToByteArray(byte[], int, long?, long?, AsyncCallback, object)
Begins an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToByteArray(byte[] target, int index, long? blobOffset, long? length, AsyncCallback callback, object state)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadRangeToStream(Stream, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToStream(Stream target, long? offset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadRangeToStream(Stream, long?, long?, AsyncCallback, object)
Begins an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToStream(Stream target, long? offset, long? length, AsyncCallback callback, object state)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToByteArray(byte[], int, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToByteArray(byte[] target, int index, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToByteArray(byte[], int, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToByteArray(byte[] target, int index, AsyncCallback callback, object state)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToFile(string, FileMode, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToFile(string path, FileMode mode, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToFile(string, FileMode, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToFile(string path, FileMode mode, AsyncCallback callback, object state)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToStream(Stream, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToStream(Stream target, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
target
StreamA Stream object representing the target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDownloadToStream(Stream, AsyncCallback, object)
Begins an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToStream(Stream target, AsyncCallback callback, object state)
Parameters
target
StreamA Stream object representing the target stream.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginExists(BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous request to check existence of the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginExists(AsyncCallback, object)
Begins an asynchronous request to check existence of the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginFetchAttributes(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginFetchAttributes(AsyncCallback, object)
Begins an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginGetAccountProperties(BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginGetAccountProperties(BlobRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
requestOptions
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object to be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginGetAccountProperties(AsyncCallback, object)
Begins an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginGetAccountProperties(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object to be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginOpenRead(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenRead(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
Remarks
On the Stream object returned by the EndOpenRead(IAsyncResult) method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the BeginFetchAttributes(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
BeginOpenRead(AsyncCallback, object)
Begins an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenRead(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
Remarks
On the Stream object returned by the EndOpenRead(IAsyncResult) method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the BeginFetchAttributes(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
BeginReleaseLease(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginReleaseLease(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginReleaseLease(AccessCondition, AsyncCallback, object)
Begins an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginReleaseLease(AccessCondition accessCondition, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginRenewLease(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginRenewLease(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginRenewLease(AccessCondition, AsyncCallback, object)
Begins an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginRenewLease(AccessCondition accessCondition, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
callback
AsyncCallbackAn optional callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginRotateEncryptionKey(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginRotateEncryptionKey(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. For this operation, there must not be an IfMatchETag, IfNoneMatchETag, IfModifiedSinceTime, or IfNotModifiedSinceTime condition.
An IfMatchETag condition will be added internally.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
BeginRotateEncryptionKey(AsyncCallback, object)
Begins an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginRotateEncryptionKey(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
BeginSetMetadata(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetMetadata(AsyncCallback, object)
Begins an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetProperties(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetProperties(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetProperties(AsyncCallback, object)
Begins an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetProperties(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSnapshot(AsyncCallback, object)
Begins an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSnapshot(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSnapshot(IDictionary<string, string>, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSnapshot(IDictionary<string, string> metadata, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
metadata
IDictionary<string, string>A collection of name-value pairs defining the metadata of the snapshot.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request, or
null
.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginStartCopy(Uri, AccessCondition, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
source
UriThe System.Uri of the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination blob. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginStartCopy(Uri, AsyncCallback, object)
Begins an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(Uri source, AsyncCallback callback, object state)
Parameters
source
UriThe System.Uri of the source blob.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginUndelete(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to undelete the soft-deleted blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUndelete(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginUndelete(AsyncCallback, object)
Begins an asynchronous operation to undelete the soft-deleted blob.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUndelete(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BreakLease(TimeSpan?, AccessCondition, BlobRequestOptions, OperationContext)
Breaks the current lease on this blob.
[DoesServiceRequest]
public virtual TimeSpan BreakLease(TimeSpan? breakPeriod = null, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
BreakLeaseAsync(TimeSpan?)
Initiates an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual Task<TimeSpan> BreakLeaseAsync(TimeSpan? breakPeriod)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.
Returns
- Task<TimeSpan>
A Task<TResult> object of type TimeSpan that represents the asynchronous operation.
BreakLeaseAsync(TimeSpan?, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual Task<TimeSpan> BreakLeaseAsync(TimeSpan? breakPeriod, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<TimeSpan>
A Task<TResult> object of type TimeSpan that represents the asynchronous operation.
BreakLeaseAsync(TimeSpan?, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual Task<TimeSpan> BreakLeaseAsync(TimeSpan? breakPeriod, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<TimeSpan>
A Task<TResult> object of type TimeSpan that represents the asynchronous operation.
BreakLeaseAsync(TimeSpan?, CancellationToken)
Initiates an asynchronous operation to break the current lease on this blob.
[DoesServiceRequest]
public virtual Task<TimeSpan> BreakLeaseAsync(TimeSpan? breakPeriod, CancellationToken cancellationToken)
Parameters
breakPeriod
TimeSpan?A TimeSpan representing the amount of time to allow the lease to remain, which will be rounded down to seconds. If
null
, the break period is the remainder of the current lease, or zero for infinite leases.cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<TimeSpan>
A Task<TResult> object of type TimeSpan that represents the asynchronous operation.
ChangeLease(string, AccessCondition, BlobRequestOptions, OperationContext)
Changes the lease ID on this blob.
[DoesServiceRequest]
public virtual string ChangeLease(string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- string
The new lease ID.
ChangeLeaseAsync(string, AccessCondition)
Initiates an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual Task<string> ChangeLeaseAsync(string proposedLeaseId, AccessCondition accessCondition)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
ChangeLeaseAsync(string, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual Task<string> ChangeLeaseAsync(string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
ChangeLeaseAsync(string, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual Task<string> ChangeLeaseAsync(string proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
ChangeLeaseAsync(string, AccessCondition, CancellationToken)
Initiates an asynchronous operation to change the lease on this blob.
[DoesServiceRequest]
public virtual Task<string> ChangeLeaseAsync(string proposedLeaseId, AccessCondition accessCondition, CancellationToken cancellationToken)
Parameters
proposedLeaseId
stringA string representing the proposed lease ID for the new lease. This cannot be null.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
Delete(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext)
Deletes the blob.
[DoesServiceRequest]
public virtual void Delete(DeleteSnapshotsOption deleteSnapshotsOption = DeleteSnapshotsOption.None, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DeleteAsync()
Initiates an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual Task DeleteAsync()
Returns
DeleteAsync(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual Task DeleteAsync(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
DeleteAsync(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual Task DeleteAsync(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DeleteAsync(CancellationToken)
Initiates an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual Task DeleteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DeleteIfExists(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext)
Deletes the blob if it already exists.
[DoesServiceRequest]
public virtual bool DeleteIfExists(DeleteSnapshotsOption deleteSnapshotsOption = DeleteSnapshotsOption.None, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the blob did already exist and was deleted; otherwisefalse
.
DeleteIfExistsAsync()
Initiates an asynchronous operation to delete the blob if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync()
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
DeleteIfExistsAsync(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to delete the blob if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
DeleteIfExistsAsync(DeleteSnapshotsOption, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to delete the blob if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(DeleteSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
deleteSnapshotsOption
DeleteSnapshotsOptionA DeleteSnapshotsOption object indicating whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
DeleteIfExistsAsync(CancellationToken)
Initiates an asynchronous operation to delete the blob if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
DownloadRangeToByteArray(byte[], int, long?, long?, AccessCondition, BlobRequestOptions, OperationContext)
Downloads a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual int DownloadRangeToByteArray(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- int
The total number of bytes read into the buffer.
DownloadRangeToByteArrayAsync(byte[], int, long?, long?)
Initiates an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? blobOffset, long? length)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadRangeToByteArrayAsync(byte[], int, long?, long?, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? blobOffset, long? length, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
blobOffset
long?The starting offset of the data range, in bytes.
length
long?The length of the data to download from the blob, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadRangeToStream(Stream, long?, long?, AccessCondition, BlobRequestOptions, OperationContext)
Downloads a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual void DownloadRangeToStream(Stream target, long? offset, long? length, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DownloadRangeToStreamAsync(Stream, long?, long?)
Initiates an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
Returns
DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadRangeToStreamAsync(Stream, long?, long?, CancellationToken)
Initiates an asynchronous operation to download a range of bytes from a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
offset
long?The offset at which to begin downloading the blob, in bytes.
length
long?The length of the data to download from the blob, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToByteArray(byte[], int, AccessCondition, BlobRequestOptions, OperationContext)
Downloads the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual int DownloadToByteArray(byte[] target, int index, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- int
The total number of bytes read into the buffer.
DownloadToByteArrayAsync(byte[], int)
Initiates an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index)
Parameters
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadToByteArrayAsync(byte[], int, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadToByteArrayAsync(byte[], int, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadToByteArrayAsync(byte[], int, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadToByteArrayAsync(byte[], int, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a byte array.
[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, CancellationToken cancellationToken)
Parameters
target
byte[]The target byte array.
index
intThe starting offset in the byte array.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<int>
A Task<TResult> object of type
int
that represents the asynchronous operation.
DownloadToFile(string, FileMode, AccessCondition, BlobRequestOptions, OperationContext)
Downloads the contents of a blob to a file.
[DoesServiceRequest]
public virtual void DownloadToFile(string path, FileMode mode, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DownloadToFileAsync(string, FileMode)
Initiates an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
Returns
DownloadToFileAsync(string, FileMode, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
DownloadToFileAsync(string, FileMode, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToFileAsync(string, FileMode, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToFileAsync(string, FileMode, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a file.
[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, CancellationToken cancellationToken)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToFileParallelAsync(string, FileMode, int, long?)
Initiates an asynchronous operation to download the contents of a blob to a file by making parallel requests.
[DoesServiceRequest]
public virtual Task DownloadToFileParallelAsync(string path, FileMode mode, int parallelIOCount, long? rangeSizeInBytes)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
parallelIOCount
intThe maximum number of ranges that can be downloaded concurrently
rangeSizeInBytes
long?The size of each individual range in bytes that is being dowloaded in parallel. The range size must be a multiple of 4 KB and a minimum of 4 MB. If no value is passed a default value of 16 MB is used or 4MB if transactional MD5 is enabled.
Returns
Remarks
The parallelIOCount and rangeSizeInBytes should be adjusted depending on the CPU, memory, and bandwidth. This API should only be used for larger downloads as a HEAD request is made prior to downloading the data. For smaller blobs, please use DownloadToFileAsync(). To get the best performance, it is recommended to try several values, and measure throughput. One place to start would be to set the parallelIOCount to the number of CPUs. Then adjust the rangeSizeInBytes so that parallelIOCount times rangeSizeInBytes equals the amount of memory you want the process to consume.
DownloadToFileParallelAsync(string, FileMode, int, long?, long, long?, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a file by making parallel requests.
[DoesServiceRequest]
public virtual Task DownloadToFileParallelAsync(string path, FileMode mode, int parallelIOCount, long? rangeSizeInBytes, long offset, long? length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
parallelIOCount
intThe maximum number of ranges that can be downloaded concurrently
rangeSizeInBytes
long?The size of each individual range in bytes that is being dowloaded in parallel. The range size must be a multiple of 4 KB and a minimum of 4 MB. If no value is passed a default value of 16 MB or 4MB if transactional MD5 is enabled.
offset
longThe offset of the blob.
length
long?The number of bytes to download.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Remarks
The parallelIOCount and rangeSizeInBytes should be adjusted depending on the CPU, memory, and bandwidth. This API should only be used for larger downloads as a HEAD request is made prior to downloading the data. For smaller blobs, please use DownloadToFileAsync(). To get the best performance, it is recommended to try several values, and measure throughput. One place to start would be to set the parallelIOCount to the number of CPUs. Then adjust the rangeSizeInBytes so that parallelIOCount times rangeSizeInBytes equals the amount of memory you want the process to consume.
DownloadToFileParallelAsync(string, FileMode, int, long?, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a file by making parallel requests.
[DoesServiceRequest]
public virtual Task DownloadToFileParallelAsync(string path, FileMode mode, int parallelIOCount, long? rangeSizeInBytes, CancellationToken cancellationToken)
Parameters
path
stringA string containing the path to the target file.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
parallelIOCount
intThe maximum number of ranges that can be downloaded concurrently.
rangeSizeInBytes
long?The size of each individual range in bytes that is being dowloaded in parallel. The range size must be a multiple of 4 KB and a minimum of 4 MB. If no value is passed a default value of 16 MB is used or 4MB if transactional MD5 is enabled.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Remarks
The parallelIOCount and rangeSizeInBytes should be adjusted depending on the CPU, memory, and bandwidth. This API should only be used for larger downloads as a HEAD request is made prior to downloading the data. For smaller blobs, please use DownloadToFileAsync(). To get the best performance, it is recommended to try several values, and measure throughput. One place to start would be to set the parallelIOCount to the number of CPUs. Then adjust the rangeSizeInBytes so that parallelIOCount times rangeSizeInBytes equals the amount of memory you want the process to consume.
Examples
It looks like the sample you are looking for does not exist.
DownloadToStream(Stream, AccessCondition, BlobRequestOptions, OperationContext)
Downloads the contents of a blob to a stream.
[DoesServiceRequest]
public virtual void DownloadToStream(Stream target, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
target
StreamA Stream object representing the target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DownloadToStreamAsync(Stream)
Initiates an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target)
Parameters
Returns
DownloadToStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
target
StreamA Stream object representing the target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
DownloadToStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToStreamAsync(Stream, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DownloadToStreamAsync(Stream, CancellationToken)
Initiates an asynchronous operation to download the contents of a blob to a stream.
[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, CancellationToken cancellationToken)
Parameters
target
StreamA Stream object representing the target stream.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
EndAbortCopy(IAsyncResult)
Ends an asynchronous operation to abort an ongoing blob copy operation.
public virtual void EndAbortCopy(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndAcquireLease(IAsyncResult)
Ends an asynchronous operation to acquire a lease on this blob.
public virtual string EndAcquireLease(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- string
The ID of the acquired lease.
EndBreakLease(IAsyncResult)
Ends an asynchronous operation to break the current lease on this blob.
public virtual TimeSpan EndBreakLease(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
EndChangeLease(IAsyncResult)
Ends an asynchronous operation to change the lease on this blob.
public virtual string EndChangeLease(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- string
The new lease ID.
EndDelete(IAsyncResult)
Ends an asynchronous operation to delete the blob.
public virtual void EndDelete(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndDeleteIfExists(IAsyncResult)
Returns the result of an asynchronous request to delete the blob if it already exists.
public virtual bool EndDeleteIfExists(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- bool
true
if the blob did already exist and was deleted; otherwise,false
.
EndDownloadRangeToByteArray(IAsyncResult)
Ends an asynchronous operation to download a range of bytes from a blob to a byte array.
public virtual int EndDownloadRangeToByteArray(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- int
The total number of bytes read into the buffer.
EndDownloadRangeToStream(IAsyncResult)
Ends an asynchronous operation to download a range of bytes from a blob to a stream.
public virtual void EndDownloadRangeToStream(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndDownloadToByteArray(IAsyncResult)
Ends an asynchronous operation to download the contents of a blob to a byte array.
public virtual int EndDownloadToByteArray(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- int
The total number of bytes read into the buffer.
EndDownloadToFile(IAsyncResult)
Ends an asynchronous operation to download the contents of a blob to a file.
public virtual void EndDownloadToFile(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndDownloadToStream(IAsyncResult)
Ends an asynchronous operation to download the contents of a blob to a stream.
public virtual void EndDownloadToStream(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndExists(IAsyncResult)
Returns the asynchronous result of the request to check existence of the blob.
public virtual bool EndExists(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- bool
true
if the blob exists.
EndFetchAttributes(IAsyncResult)
Ends an asynchronous operation to populate the blob's properties and metadata.
public virtual void EndFetchAttributes(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndGetAccountProperties(IAsyncResult)
Ends an asynchronous operation to get properties for the account this blob resides on.
public virtual AccountProperties EndGetAccountProperties(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- AccountProperties
A AccountProperties object.
EndOpenRead(IAsyncResult)
Ends an asynchronous operation to open a stream for reading from the blob.
public virtual Stream EndOpenRead(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
Remarks
On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
EndReleaseLease(IAsyncResult)
Ends an asynchronous operation to release the lease on this blob.
public virtual void EndReleaseLease(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndRenewLease(IAsyncResult)
Ends an asynchronous operation to renew a lease on this blob.
public virtual void EndRenewLease(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndRotateEncryptionKey(IAsyncResult)
Ends an asynchronous operation to rotate the encryption key on this blob.
public virtual void EndRotateEncryptionKey(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndSetMetadata(IAsyncResult)
Ends an asynchronous operation to update the blob's metadata.
public virtual void EndSetMetadata(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndSetProperties(IAsyncResult)
Ends an asynchronous operation to update the blob's properties.
public virtual void EndSetProperties(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndSnapshot(IAsyncResult)
Ends an asynchronous operation to create a snapshot of the blob.
public virtual CloudBlob EndSnapshot(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
EndStartCopy(IAsyncResult)
Ends an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
public virtual string EndStartCopy(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- string
A string containing the copy ID associated with the copy operation.
Remarks
This method fetches the blob's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
EndUndelete(IAsyncResult)
Ends an asynchronous operation to undelete the soft-deleted blob.
public virtual void EndUndelete(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Exists(BlobRequestOptions, OperationContext)
Checks existence of the blob.
[DoesServiceRequest]
public virtual bool Exists(BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the blob exists.
ExistsAsync()
Initiates an asynchronous operation to check existence of the blob.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync()
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
ExistsAsync(BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to check existence of the blob.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(BlobRequestOptions options, OperationContext operationContext)
Parameters
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
ExistsAsync(BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to check existence of the blob.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
ExistsAsync(CancellationToken)
Initiates an asynchronous operation to check existence of the blob.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object of type
bool
that represents the asynchronous operation.
FetchAttributes(AccessCondition, BlobRequestOptions, OperationContext)
Populates a blob's properties and metadata.
[DoesServiceRequest]
public virtual void FetchAttributes(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
FetchAttributesAsync()
Initiates an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync()
Returns
FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
FetchAttributesAsync(CancellationToken)
Initiates an asynchronous operation to populate the blob's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
GetAccountProperties(BlobRequestOptions, OperationContext)
Get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual AccountProperties GetAccountProperties(BlobRequestOptions requestOptions = null, OperationContext operationContext = null)
Parameters
requestOptions
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- AccountProperties
An AccountProperties object.
GetAccountPropertiesAsync()
Initiates an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual Task<AccountProperties> GetAccountPropertiesAsync()
Returns
- Task<AccountProperties>
A Task<TResult> object of type AccountProperties that represents the asynchronous operation.
GetAccountPropertiesAsync(BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual Task<AccountProperties> GetAccountPropertiesAsync(BlobRequestOptions requestOptions, OperationContext operationContext)
Parameters
requestOptions
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<AccountProperties>
A Task<TResult> object of type AccountProperties that represents the asynchronous operation.
GetAccountPropertiesAsync(BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual Task<AccountProperties> GetAccountPropertiesAsync(BlobRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
requestOptions
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<AccountProperties>
A Task<TResult> object of type AccountProperties that represents the asynchronous operation.
GetAccountPropertiesAsync(CancellationToken)
Initiates an asynchronous operation to get properties for the account this blob resides on.
[DoesServiceRequest]
public virtual Task<AccountProperties> GetAccountPropertiesAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<AccountProperties>
A Task<TResult> object of type AccountProperties that represents the asynchronous operation.
GetSharedAccessSignature(SharedAccessBlobPolicy)
Returns a shared access signature for the blob.
public string GetSharedAccessSignature(SharedAccessBlobPolicy policy)
Parameters
policy
SharedAccessBlobPolicyA SharedAccessBlobPolicy object specifying the access policy for the shared access signature.
Returns
- string
A shared access signature, as a URI query string.
Remarks
The query string returned includes the leading question mark.
GetSharedAccessSignature(SharedAccessBlobPolicy, SharedAccessBlobHeaders)
Returns a shared access signature for the blob.
public string GetSharedAccessSignature(SharedAccessBlobPolicy policy, SharedAccessBlobHeaders headers)
Parameters
policy
SharedAccessBlobPolicyA SharedAccessBlobPolicy object specifying the access policy for the shared access signature.
headers
SharedAccessBlobHeadersA SharedAccessBlobHeaders object specifying optional header values to set for a blob accessed with this SAS.
Returns
- string
A shared access signature, as a URI query string.
GetSharedAccessSignature(SharedAccessBlobPolicy, SharedAccessBlobHeaders, string)
Returns a shared access signature for the blob.
public string GetSharedAccessSignature(SharedAccessBlobPolicy policy, SharedAccessBlobHeaders headers, string groupPolicyIdentifier)
Parameters
policy
SharedAccessBlobPolicyA SharedAccessBlobPolicy object specifying the access policy for the shared access signature.
headers
SharedAccessBlobHeadersA SharedAccessBlobHeaders object specifying optional header values to set for a blob accessed with this SAS.
groupPolicyIdentifier
stringA string identifying a stored access policy.
Returns
- string
A shared access signature, as a URI query string.
GetSharedAccessSignature(SharedAccessBlobPolicy, SharedAccessBlobHeaders, string, SharedAccessProtocol?, IPAddressOrRange)
Returns a shared access signature for the blob.
public string GetSharedAccessSignature(SharedAccessBlobPolicy policy, SharedAccessBlobHeaders headers, string groupPolicyIdentifier, SharedAccessProtocol? protocols, IPAddressOrRange ipAddressOrRange)
Parameters
policy
SharedAccessBlobPolicyA SharedAccessBlobPolicy object specifying the access policy for the shared access signature.
headers
SharedAccessBlobHeadersA SharedAccessBlobHeaders object specifying optional header values to set for a blob accessed with this SAS.
groupPolicyIdentifier
stringA string identifying a stored access policy.
protocols
SharedAccessProtocol?The allowed protocols (https only, or http and https). Null if you don't want to restrict protocol.
ipAddressOrRange
IPAddressOrRangeThe allowed IP address or IP address range. Null if you don't want to restrict based on IP address.
Returns
- string
A shared access signature, as a URI query string.
GetSharedAccessSignature(SharedAccessBlobPolicy, string)
Returns a shared access signature for the blob.
public string GetSharedAccessSignature(SharedAccessBlobPolicy policy, string groupPolicyIdentifier)
Parameters
policy
SharedAccessBlobPolicyA SharedAccessBlobPolicy object specifying the access policy for the shared access signature.
groupPolicyIdentifier
stringA string identifying a stored access policy.
Returns
- string
A shared access signature, as a URI query string.
Remarks
The query string returned includes the leading question mark.
OpenRead(AccessCondition, BlobRequestOptions, OperationContext)
Opens a stream for reading from the blob.
[DoesServiceRequest]
public virtual Stream OpenRead(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
Remarks
Note that this method always makes a call to the FetchAttributes(AccessCondition, BlobRequestOptions, OperationContext) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
OpenReadAsync()
Initiates an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync()
Returns
- Task<Stream>
A Task<TResult> object of type Stream that represents the asynchronous operation.
Remarks
On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
OpenReadAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<Stream>
A Task<TResult> object of type Stream that represents the asynchronous operation.
Remarks
On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
OpenReadAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<Stream>
A Task<TResult> object of type Stream that represents the asynchronous operation.
Remarks
On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
OpenReadAsync(CancellationToken)
Initiates an asynchronous operation to open a stream for reading from the blob.
[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<Stream>
A Task<TResult> object of type Stream that represents the asynchronous operation.
Remarks
On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end the read process before beginning another read process can cause unexpected behavior.
Note that this method always makes a call to the FetchAttributesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken) method under the covers.
Set the StreamMinimumReadSizeInBytes property before calling this method to specify the minimum number of bytes to buffer when reading from the stream. The value must be at least 16 KB.
ReleaseLease(AccessCondition, BlobRequestOptions, OperationContext)
Releases the lease on this blob.
[DoesServiceRequest]
public virtual void ReleaseLease(AccessCondition accessCondition, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
ReleaseLeaseAsync(AccessCondition)
Initiates an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual Task ReleaseLeaseAsync(AccessCondition accessCondition)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
Returns
ReleaseLeaseAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual Task ReleaseLeaseAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
ReleaseLeaseAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual Task ReleaseLeaseAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
ReleaseLeaseAsync(AccessCondition, CancellationToken)
Initiates an asynchronous operation to release the lease on this blob.
[DoesServiceRequest]
public virtual Task ReleaseLeaseAsync(AccessCondition accessCondition, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
RenewLease(AccessCondition, BlobRequestOptions, OperationContext)
Renews a lease on this blob.
[DoesServiceRequest]
public virtual void RenewLease(AccessCondition accessCondition, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
RenewLeaseAsync(AccessCondition)
Initiates an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual Task RenewLeaseAsync(AccessCondition accessCondition)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
Returns
RenewLeaseAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual Task RenewLeaseAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
RenewLeaseAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual Task RenewLeaseAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
RenewLeaseAsync(AccessCondition, CancellationToken)
Initiates an asynchronous operation to renew a lease on this blob.
[DoesServiceRequest]
public virtual Task RenewLeaseAsync(AccessCondition accessCondition, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed, including a required lease ID.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
RotateEncryptionKey(AccessCondition, BlobRequestOptions, OperationContext)
Rotates the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual void RotateEncryptionKey(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. For this operation, there must not be an IfMatchETag, IfNoneMatchETag, IfModifiedSinceTime, or IfNotModifiedSinceTime condition.
An IfMatchETag condition will be added internally.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
RotateEncryptionKeyAsync()
Initiates an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual Task RotateEncryptionKeyAsync()
Returns
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
RotateEncryptionKeyAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual Task RotateEncryptionKeyAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. For this operation, there must not be an IfMatchETag, IfNoneMatchETag, IfModifiedSinceTime, or IfNotModifiedSinceTime condition.
An IfMatchETag condition will be added internally.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
RotateEncryptionKeyAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual Task RotateEncryptionKeyAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. For this operation, there must not be an IfMatchETag, IfNoneMatchETag, IfModifiedSinceTime, or IfNotModifiedSinceTime condition.
An IfMatchETag condition will be added internally.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
RotateEncryptionKeyAsync(CancellationToken)
Initiates an asynchronous operation to rotate the encryption key on this blob. This method rotates only the KEK, not the CEK. For more information, visit https://azure.microsoft.com/en-us/documentation/articles/storage-client-side-encryption/
[DoesServiceRequest]
public virtual Task RotateEncryptionKeyAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Remarks
This method has a number of prerequisites:
- The blob must be encrypted on the service using client-side encryption (not service-side encryption.)
- The local object must have the latest attributes from the blob on the service. This can be done by calling FetchAttributes() on the blob, or by listing blobs in the container with metadata.
- The Encryption Policy on the default BlobRequestOptions must contain an IKeyResolver capable of resolving the old encryption key.
- The Encryption Policy on the default BlobRequestOptions must contain an IKey with the new encryption key.
SetMetadata(AccessCondition, BlobRequestOptions, OperationContext)
Updates the blob's metadata.
[DoesServiceRequest]
public virtual void SetMetadata(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
SetMetadataAsync()
Initiates an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync()
Returns
SetMetadataAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
SetMetadataAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
SetMetadataAsync(CancellationToken)
Initiates an asynchronous operation to update the blob's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
SetProperties(AccessCondition, BlobRequestOptions, OperationContext)
Updates the blob's properties.
[DoesServiceRequest]
public virtual void SetProperties(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
SetPropertiesAsync()
Initiates an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual Task SetPropertiesAsync()
Returns
SetPropertiesAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
SetPropertiesAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
SetPropertiesAsync(CancellationToken)
Initiates an asynchronous operation to update the blob's properties.
[DoesServiceRequest]
public virtual Task SetPropertiesAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Snapshot(IDictionary<string, string>, AccessCondition, BlobRequestOptions, OperationContext)
Creates a snapshot of the blob.
[DoesServiceRequest]
public virtual CloudBlob Snapshot(IDictionary<string, string> metadata = null, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
metadata
IDictionary<string, string>A collection of name-value pairs defining the metadata of the snapshot.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request, or
null
. Ifnull
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
SnapshotAsync()
Initiates an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual Task<CloudBlob> SnapshotAsync()
Returns
- Task<CloudBlob>
A Task<TResult> object of type CloudBlob that represents the asynchronous operation.
SnapshotAsync(IDictionary<string, string>, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual Task<CloudBlob> SnapshotAsync(IDictionary<string, string> metadata, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
metadata
IDictionary<string, string>A collection of name-value pairs defining the metadata of the snapshot.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<CloudBlob>
A Task<TResult> object of type CloudBlob that represents the asynchronous operation.
SnapshotAsync(IDictionary<string, string>, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual Task<CloudBlob> SnapshotAsync(IDictionary<string, string> metadata, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
metadata
IDictionary<string, string>A collection of name-value pairs defining the metadata of the snapshot.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<CloudBlob>
A Task<TResult> object of type CloudBlob that represents the asynchronous operation.
SnapshotAsync(CancellationToken)
Initiates an asynchronous operation to create a snapshot of the blob.
[DoesServiceRequest]
public virtual Task<CloudBlob> SnapshotAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<CloudBlob>
A Task<TResult> object of type CloudBlob that represents the asynchronous operation.
StartCopy(Uri, AccessCondition, AccessCondition, BlobRequestOptions, OperationContext)
Begins an operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual string StartCopy(Uri source, AccessCondition sourceAccessCondition = null, AccessCondition destAccessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
source
UriThe System.Uri of the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination blob. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- string
The copy ID associated with the copy operation.
Remarks
This method fetches the blob's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
StartCopyAsync(Uri)
Initiates an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source)
Parameters
source
UriThe System.Uri of the source blob.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
StartCopyAsync(Uri, AccessCondition, AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
source
UriThe System.Uri of the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination blob. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
StartCopyAsync(Uri, AccessCondition, AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
source
UriThe System.Uri of the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination blob. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
StartCopyAsync(Uri, CancellationToken)
Initiates an asynchronous operation to start copying another blob's contents, properties, and metadata to this blob.
[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, CancellationToken cancellationToken)
Parameters
source
UriThe System.Uri of the source blob.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<string>
A Task<TResult> object of type
string
that represents the asynchronous operation.
Undelete(AccessCondition, BlobRequestOptions, OperationContext)
UnDeletes the blob if it is soft-deleted.
[DoesServiceRequest]
public virtual void Undelete(AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
UndeleteAsync()
Initiates an asynchronous operation to undelete the soft-deleted blob.
[DoesServiceRequest]
public virtual Task UndeleteAsync()
Returns
UndeleteAsync(AccessCondition, BlobRequestOptions, OperationContext)
Initiates an asynchronous operation to undelete the soft-deleted blob.
[DoesServiceRequest]
public virtual Task UndeleteAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
UndeleteAsync(AccessCondition, BlobRequestOptions, OperationContext, CancellationToken)
Initiates an asynchronous operation to undelete the soft-deleted blob.
[DoesServiceRequest]
public virtual Task UndeleteAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
UndeleteAsync(CancellationToken)
Initiates an asynchronous operation to delete the blob.
[DoesServiceRequest]
public virtual Task UndeleteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.