Class AppendBlobClient
The AppendBlobClient allows you to manipulate Azure Storage append blobs.
An append blob is comprised of blocks and is optimized for append operations. When you modify an append blob, blocks are added to the end of the blob only, via the AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation. Updating or deleting of existing blocks is not supported. Unlike a block blob, an append blob does not expose its block IDs.
Each block in an append blob can be a different size, up to a maximum of 4 MB, and an append blob can include up to 50,000 blocks. The maximum size of an append blob is therefore slightly more than 195 GB (4 MB X 50,000 blocks).
Inherited Members
Namespace: Azure.Storage.Blobs.Specialized
Assembly: Azure.Storage.Blobs.dll
Syntax
public class AppendBlobClient : Azure.Storage.Blobs.Specialized.BlobBaseClient
Constructors
AppendBlobClient()
Initializes a new instance of the AppendBlobClient class for mocking.
Declaration
protected AppendBlobClient ();
AppendBlobClient(Uri, BlobClientOptions)
Initializes a new instance of the AppendBlobClient class.
Declaration
public AppendBlobClient (Uri blobUri, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
Uri
blobUri
A Uri referencing the append blob that includes the name of the account, the name of the container, and the name of the blob. |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
AppendBlobClient(String, String, String)
Initializes a new instance of the AppendBlobClient class.
Declaration
public AppendBlobClient (string connectionString, string blobContainerName, string blobName);
Parameters
String
connectionString
A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime. |
String
blobContainerName
The name of the container containing this append blob. |
String
blobName
The name of this append blob. |
AppendBlobClient(Uri, TokenCredential, BlobClientOptions)
Initializes a new instance of the AppendBlobClient class.
Declaration
public AppendBlobClient (Uri blobUri, Azure.Core.TokenCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
Uri
blobUri
A Uri referencing the append blob that includes the name of the account, the name of the container, and the name of the blob. |
TokenCredential
credential
The token credential used to sign requests. |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
AppendBlobClient(Uri, StorageSharedKeyCredential, BlobClientOptions)
AppendBlobClient(String, String, String, BlobClientOptions)
Initializes a new instance of the AppendBlobClient class.
Declaration
public AppendBlobClient (string connectionString, string blobContainerName, string blobName, Azure.Storage.Blobs.BlobClientOptions options);
Parameters
String
connectionString
A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime. |
String
blobContainerName
The name of the container containing this append blob. |
String
blobName
The name of this append blob. |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
Properties
AppendBlobMaxAppendBlockBytes
Gets the maximum number of bytes that can be sent in a call to AppendBlock.
Declaration
public virtual int AppendBlobMaxAppendBlockBytes { get; }
Property Value
Int32
|
AppendBlobMaxBlocks
Gets the maximum number of blocks allowed in an append blob.
Declaration
public virtual int AppendBlobMaxBlocks { get; }
Property Value
Int32
|
Methods
AppendBlock(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken)
The AppendBlock(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation commits a new block
of data, represented by the content
Stream,
to the end of the existing append blob. The AppendBlock(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken)
operation is only permitted if the blob was created as an append
blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobAppendInfo> AppendBlock (System.IO.Stream content, byte[] transactionalContentHash = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, IProgress<long> progressHandler = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Stream
content
A Stream containing the content of the block to append. |
Byte[]
transactionalContentHash
Optional MD5 hash of the block content. This hash is used to verify the integrity of the block during transport. When this hash is specified, the storage service compares the hash of the content that has arrived with this value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation will fail with a RequestFailedException. |
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on appending content to this append blob. |
IProgress<Int64>
progressHandler
Optional IProgress<T> to provide progress updates about data transfers. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Response<BlobAppendInfo>
A Response<T> describing the state of the updated append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken)
The AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation commits a new block
of data, represented by the content
Stream,
to the end of the existing append blob. The AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken)
operation is only permitted if the blob was created as an append
blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobAppendInfo>> AppendBlockAsync (System.IO.Stream content, byte[] transactionalContentHash = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, IProgress<long> progressHandler = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Stream
content
A Stream containing the content of the block to append. |
Byte[]
transactionalContentHash
Optional MD5 hash of the block content. This hash is used to verify the integrity of the block during transport. When this hash is specified, the storage service compares the hash of the content that has arrived with this value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation will fail with a RequestFailedException. |
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on appending content to this append blob. |
IProgress<Int64>
progressHandler
Optional IProgress<T> to provide progress updates about data transfers. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Task<Response<BlobAppendInfo>>
A Response<T> describing the state of the updated append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
AppendBlockFromUri(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken)
The AppendBlockFromUri(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken) operation commits a new
block of data, represented by the sourceUri
,
to the end of the existing append blob. The
AppendBlockFromUri(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken) operation is only permitted
if the blob was created as an append blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobAppendInfo> AppendBlockFromUri (Uri sourceUri, Azure.HttpRange sourceRange = null, byte[] sourceContentHash = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions sourceConditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Uri
sourceUri
Specifies the Uri of the source blob. The value may be a Uri of up to 2 KB in length that specifies a blob. The source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation. |
HttpRange
sourceRange
Optionally only upload the bytes of the blob in the
|
Byte[]
sourceContentHash
Optional MD5 hash of the append block content from the
|
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on the copying of data to this append blob. |
AppendBlobRequestConditions
sourceConditions
Optional AppendBlobRequestConditions to add conditions on the copying of data from this source blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Response<BlobAppendInfo>
A Response<T> describing the state of the updated append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
AppendBlockFromUriAsync(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken)
The AppendBlockFromUriAsync(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken) operation commits a new
block of data, represented by the sourceUri
,
to the end of the existing append blob. The
AppendBlockFromUriAsync(Uri, HttpRange, Byte[], AppendBlobRequestConditions, AppendBlobRequestConditions, CancellationToken) operation is only permitted
if the blob was created as an append blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobAppendInfo>> AppendBlockFromUriAsync (Uri sourceUri, Azure.HttpRange sourceRange = null, byte[] sourceContentHash = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions sourceConditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Uri
sourceUri
Specifies the Uri of the source blob. The value may be a Uri of up to 2 KB in length that specifies a blob. The source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation. |
HttpRange
sourceRange
Optionally only upload the bytes of the blob in the
|
Byte[]
sourceContentHash
Optional MD5 hash of the append block content from the
|
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on the copying of data to this append blob. |
AppendBlobRequestConditions
sourceConditions
Optional AppendBlobRequestConditions to add conditions on the copying of data from this source blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Task<Response<BlobAppendInfo>>
A Response<T> describing the state of the updated append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
Create(BlobHttpHeaders, IDictionary<String,String>, AppendBlobRequestConditions, CancellationToken)
The Create(BlobHttpHeaders, IDictionary<String,String>, AppendBlobRequestConditions, CancellationToken) operation creates a new 0-length append blob. The content of any existing blob is overwritten with the newly initialized append blob. To add content to the append blob, call the AppendBlock(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Create (Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the new append blob. |
IDictionary<String,String>
metadata
Optional custom metadata to set for this append blob. |
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on the creation of this new append blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Response<BlobContentInfo>
A Response<T> describing the newly created append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
CreateAsync(BlobHttpHeaders, IDictionary<String,String>, AppendBlobRequestConditions, CancellationToken)
The CreateAsync(BlobHttpHeaders, IDictionary<String,String>, AppendBlobRequestConditions, CancellationToken) operation creates a new 0-length append blob. The content of any existing blob is overwritten with the newly initialized append blob. To add content to the append blob, call the AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> CreateAsync (Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.AppendBlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the new append blob. |
IDictionary<String,String>
metadata
Optional custom metadata to set for this append blob. |
AppendBlobRequestConditions
conditions
Optional AppendBlobRequestConditions to add conditions on the creation of this new append blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Task<Response<BlobContentInfo>>
A Response<T> describing the newly created append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
CreateIfNotExists(BlobHttpHeaders, IDictionary<String,String>, CancellationToken)
The CreateIfNotExists(BlobHttpHeaders, IDictionary<String,String>, CancellationToken) operation creates a new 0-length append blob. If the append blob already exists, the content of the existing append blob will remain unchanged. To add content to the append blob, call the AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> CreateIfNotExists (Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the new append blob. |
IDictionary<String,String>
metadata
Optional custom metadata to set for this append blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Response<BlobContentInfo>
A Response<T> describing the newly created append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
CreateIfNotExistsAsync(BlobHttpHeaders, IDictionary<String,String>, CancellationToken)
The CreateIfNotExistsAsync(BlobHttpHeaders, IDictionary<String,String>, CancellationToken) operation creates a new 0-length append blob. If the append blob already exists, the content of the existing append blob will remain unchanged. To add content to the append blob, call the AppendBlockAsync(Stream, Byte[], AppendBlobRequestConditions, IProgress<Int64>, CancellationToken) operation.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> CreateIfNotExistsAsync (Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the new append blob. |
IDictionary<String,String>
metadata
Optional custom metadata to set for this append blob. |
CancellationToken
cancellationToken
Optional CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Task<Response<BlobContentInfo>>
A Response<T> describing the newly created append blob. |
Remarks
A RequestFailedException will be thrown if a failure occurs.
WithSnapshot(String)
Initializes a new instance of the AppendBlobClient
class with an identical Uri source but the specified
snapshot
timestamp.
Declaration
public Azure.Storage.Blobs.Specialized.AppendBlobClient WithSnapshot (string snapshot);
Parameters
String
snapshot
The snapshot identifier. |
Returns
AppendBlobClient
A new AppendBlobClient instance. |
Remarks
Pass null or empty string to remove the snapshot returning a URL
to the base blob.