共用方式為


BlockBlobClient Class

Definition

The BlockBlobClient allows you to manipulate Azure Storage block blobs.

Block blobs let you upload large blobs efficiently. Block blobs are comprised of blocks, each of which is identified by a block ID. You create or modify a block blob by writing a set of blocks and committing them by their block IDs. Each block can be a different size, up to a maximum of 4,000 MB (100 MB for requests using REST versions before 2019-12-12 and 4 MB for requests using REST versions before 2016-05-31), and a block blob can include up to 50,000 blocks. The maximum size of a block blob is therefore approximately 190.73 TiB (4,000 MB X 50,000 blocks). If you are writing a block blob that is no more than 5,000 MB in size, you can upload it in its entirety with a single write operation; see UploadAsync(Stream, BlobUploadOptions, CancellationToken).

When you upload a block to a blob in your storage account, it is associated with the specified block blob, but it does not become part of the blob until you commit a list of blocks that includes the new block's ID. New blocks remain in an uncommitted state until they are specifically committed or discarded. Writing a block does not update the last modified time of an existing blob.

Block blobs include features that help you manage large files over networks. With a block blob, you can upload multiple blocks in parallel to decrease upload time. Each block can include an MD5 hash to verify the transfer, so you can track upload progress and re-send blocks as needed.You can upload blocks in any order, and determine their sequence in the final block list commitment step. You can also upload a new block to replace an existing uncommitted block of the same block ID. You have one week to commit blocks to a blob before they are discarded. All uncommitted blocks are also discarded when a block list commitment operation occurs but does not include them.

You can modify an existing block blob by inserting, replacing, or deleting existing blocks. After uploading the block or blocks that have changed, you can commit a new version of the blob by committing the new blocks with the existing blocks you want to keep using a single commit operation. To insert the same range of bytes in two different locations of the committed blob, you can commit the same block in two places within the same commit operation.For any commit operation, if any block is not found, the entire commitment operation fails with an error, and the blob is not modified. Any block commitment overwrites the blob’s existing properties and metadata, and discards all uncommitted blocks.

Block IDs are strings of equal length within a blob. Block client code usually uses base-64 encoding to normalize strings into equal lengths. When using base-64 encoding, the pre-encoded string must be 64 bytes or less. Block ID values can be duplicated in different blobs. A blob can have up to 100,000 uncommitted blocks, with a max total size of appoximately 381.46 TiB (4,000 MB x 100,000 blocks)

If you write a block for a blob that does not exist, a new block blob is created, with a length of zero bytes. This blob will appear in blob lists that include uncommitted blobs. If you don’t commit any block to this blob, it and its uncommitted blocks will be discarded one week after the last successful block upload. All uncommitted blocks are also discarded when a new blob of the same name is created using a single step(rather than the two-step block upload-then-commit process).

public class BlockBlobClient : Azure.Storage.Blobs.Specialized.BlobBaseClient
type BlockBlobClient = class
    inherit BlobBaseClient
Public Class BlockBlobClient
Inherits BlobBaseClient
Inheritance
BlockBlobClient

Constructors

BlockBlobClient()

Initializes a new instance of the BlockBlobClient class for mocking.

BlockBlobClient(String, String, String, BlobClientOptions)

Initializes a new instance of the BlockBlobClient class.

BlockBlobClient(String, String, String)

Initializes a new instance of the BlockBlobClient class.

BlockBlobClient(Uri, AzureSasCredential, BlobClientOptions)

Initializes a new instance of the BlockBlobClient class.

BlockBlobClient(Uri, BlobClientOptions)

Initializes a new instance of the BlockBlobClient class.

BlockBlobClient(Uri, StorageSharedKeyCredential, BlobClientOptions)

Initializes a new instance of the BlockBlobClient class.

BlockBlobClient(Uri, TokenCredential, BlobClientOptions)

Initializes a new instance of the BlockBlobClient class.

Properties

AccountName

Gets the Storage account name corresponding to the blob client.

(Inherited from BlobBaseClient)
BlobContainerName

Gets the container name corresponding to the blob client.

(Inherited from BlobBaseClient)
BlockBlobMaxBlocks

Gets the maximum number of blocks allowed in a block blob.

BlockBlobMaxStageBlockLongBytes

Gets the maximum number of bytes that can be sent in a call to Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlockAsync(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken).

BlockBlobMaxUploadBlobLongBytes

Gets the maximum number of bytes that can be sent in a call to UploadAsync(Stream, BlobUploadOptions, CancellationToken).

CanGenerateSasUri

Indicates whether the client is able to generate a SAS uri. Client can generate a SAS url if it is authenticated with a StorageSharedKeyCredential.

(Inherited from BlobBaseClient)
Name

Gets the name of the blob.

(Inherited from BlobBaseClient)
Uri

Gets the blob's primary Uri endpoint.

(Inherited from BlobBaseClient)

Methods

AbortCopyFromUri(String, BlobRequestConditions, CancellationToken)

The AbortCopyFromUri(String, BlobRequestConditions, CancellationToken) operation aborts a pending CopyFromUriOperation, and leaves a this blob with zero length and full metadata.

For more information, see Abort Copy Blob.

(Inherited from BlobBaseClient)
AbortCopyFromUriAsync(String, BlobRequestConditions, CancellationToken)

The AbortCopyFromUriAsync(String, BlobRequestConditions, CancellationToken) operation aborts a pending CopyFromUriOperation, and leaves a this blob with zero length and full metadata.

For more information, see Abort Copy Blob.

(Inherited from BlobBaseClient)
CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken)

The CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken) operation. You can call CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken) to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to. Any blocks not specified in the block list and permanently deleted.

For more information, see Put Block List.

CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken)

The CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken) operation. You can call CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to. Any blocks not specified in the block list and permanently deleted.

For more information, see Put Block List.

CreateClient(Uri, BlobClientOptions, HttpPipeline)

Initializes a new instance of the BlockBlobClient class.

CreateSnapshot(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

The CreateSnapshot(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation creates a read-only snapshot of a blob.

For more information, see Snapshot Blob.

(Inherited from BlobBaseClient)
CreateSnapshotAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

The CreateSnapshotAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation creates a read-only snapshot of a blob.

For more information, see Snapshot Blob.

(Inherited from BlobBaseClient)
Delete(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The Delete(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection which could take several minutes.

Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.

For more information, see Delete Blob.

(Inherited from BlobBaseClient)
DeleteAsync(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteAsync(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection which could take several minutes.

Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.

For more information, see Delete Blob.

(Inherited from BlobBaseClient)
DeleteIfExists(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteIfExists(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob exists. The blob is later deleted during garbage collection which could take several minutes.

Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.

For more information, see Delete Blob.

(Inherited from BlobBaseClient)
DeleteIfExistsAsync(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteIfExistsAsync(DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob exists. The blob is later deleted during garbage collection which could take several minutes.

Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.

For more information, see Delete Blob.

(Inherited from BlobBaseClient)
DeleteImmutabilityPolicy(CancellationToken)

Deletes the Immutability Policy associated with the Blob. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
DeleteImmutabilityPolicyAsync(CancellationToken)

Deletes the Immutability Policy associated with the Blob. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
DownloadContent()

The DownloadContent() operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadContent(BlobDownloadOptions, CancellationToken)

The DownloadContent(BlobDownloadOptions, CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadContent(CancellationToken)

The DownloadContent(CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadContentAsync()

The DownloadContentAsync() operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadContentAsync(BlobDownloadOptions, CancellationToken)

The DownloadContentAsync(BlobDownloadOptions, CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadContentAsync(CancellationToken)

The DownloadContentAsync(CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadStreaming(BlobDownloadOptions, CancellationToken)

The DownloadStreaming(BlobDownloadOptions, CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadStreamingAsync(BlobDownloadOptions, CancellationToken)

The DownloadStreamingAsync(BlobDownloadOptions, CancellationToken) operation downloads a blob from the service, including its metadata and properties.

For more information, see Get Blob.

(Inherited from BlobBaseClient)
DownloadTo(Stream, BlobDownloadToOptions, CancellationToken)

The Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadTo(System.String,Azure.Storage.Blobs.Models.BlobRequestConditions,Azure.Storage.StorageTransferOptions,System.Threading.CancellationToken) operation downloads a blob using parallel requests, and writes the content to options.Path.Path or options.Stream.Stream.

(Inherited from BlobBaseClient)
DownloadTo(Stream, CancellationToken)

The DownloadTo(Stream, CancellationToken) operation downloads a blob using parallel requests, and writes the content to destination.

(Inherited from BlobBaseClient)
DownloadTo(Stream)

The DownloadTo(Stream) operation downloads a blob using parallel requests, and writes the content to destination.

(Inherited from BlobBaseClient)
DownloadTo(String, BlobDownloadToOptions, CancellationToken)

The Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadTo(System.String,Azure.Storage.Blobs.Models.BlobRequestConditions,Azure.Storage.StorageTransferOptions,System.Threading.CancellationToken) operation downloads a blob using parallel requests, and writes the content to options.Path.Path or options.Stream.Stream.

(Inherited from BlobBaseClient)
DownloadTo(String, CancellationToken)

The DownloadTo(String, CancellationToken) operation downloads a blob using parallel requests, and writes the content to path.

(Inherited from BlobBaseClient)
DownloadTo(String)

The DownloadTo(String) operation downloads a blob using parallel requests, and writes the content to path.

(Inherited from BlobBaseClient)
DownloadToAsync(Stream, BlobDownloadToOptions, CancellationToken)

The Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadToAsync(System.IO.Stream,Azure.Storage.Blobs.Models.BlobRequestConditions,Azure.Storage.StorageTransferOptions,System.Threading.CancellationToken) operation downloads a blob using parallel requests, and writes the content to options.Path.Path or options.Stream.Stream.

(Inherited from BlobBaseClient)
DownloadToAsync(Stream, CancellationToken)

The DownloadToAsync(Stream, CancellationToken) operation downloads a blob using parallel requests, and writes the content to destination.

(Inherited from BlobBaseClient)
DownloadToAsync(Stream)

The DownloadToAsync(Stream) downloads a blob using parallel requests, and writes the content to destination.

(Inherited from BlobBaseClient)
DownloadToAsync(String, BlobDownloadToOptions, CancellationToken)

The Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadToAsync(System.IO.Stream,Azure.Storage.Blobs.Models.BlobRequestConditions,Azure.Storage.StorageTransferOptions,System.Threading.CancellationToken) operation downloads a blob using parallel requests, and writes the content to options.Path.Path or options.Stream.Stream.

(Inherited from BlobBaseClient)
DownloadToAsync(String, CancellationToken)

The DownloadToAsync(String, CancellationToken) operation downloads a blob using parallel requests, and writes the content to path.

(Inherited from BlobBaseClient)
DownloadToAsync(String)

The DownloadToAsync(String) downloads a blob using parallel requests, and writes the content to path.

(Inherited from BlobBaseClient)
Exists(CancellationToken)

The Exists(CancellationToken) operation can be called on a BlobBaseClient to see if the associated blob exists in the container on the storage account in the storage service.

(Inherited from BlobBaseClient)
ExistsAsync(CancellationToken)

The ExistsAsync(CancellationToken) operation can be called on a BlobBaseClient to see if the associated blob exists in the container on the storage account in the storage service.

(Inherited from BlobBaseClient)
GenerateSasUri(BlobSasBuilder)

The GenerateSasUri(BlobSasBuilder) returns a Uri that generates a Blob Service Shared Access Signature (SAS) Uri based on the Client properties and and builder. The SAS is signed by the shared key credential of the client.

To check if the client is able to sign a Service Sas see CanGenerateSasUri.

For more information, see Constructing a Service SAS.

(Inherited from BlobBaseClient)
GenerateSasUri(BlobSasPermissions, DateTimeOffset)

The GenerateSasUri(BlobSasPermissions, DateTimeOffset) returns a Uri that generates a Blob Service Shared Access Signature (SAS) Uri based on the Client properties and parameters passed. The SAS is signed by the shared key credential of the client.

To check if the client is able to sign a Service Sas see CanGenerateSasUri.

For more information, see Constructing a service SAS.

(Inherited from BlobBaseClient)
GenerateUserDelegationSasUri(BlobSasBuilder, UserDelegationKey)

The GenerateUserDelegationSasUri(BlobSasBuilder, UserDelegationKey) returns a Uri representing a Blob Service Shared Access Signature (SAS) Uri based on the Client properties and builder passed. The SAS is signed by the user delegation key that is passed in.

For more information, see Creating an user delegation SAS.

(Inherited from BlobBaseClient)
GenerateUserDelegationSasUri(BlobSasPermissions, DateTimeOffset, UserDelegationKey)

The GenerateUserDelegationSasUri(BlobSasPermissions, DateTimeOffset, UserDelegationKey) returns a Uri representing a Blob Service Shared Access Signature (SAS) Uri based on the Client properties and parameters passed. The SAS is signed by the user delegation key that is passed in.

For more information, see Creating an user delegation SAS.

(Inherited from BlobBaseClient)
GetAccountInfo(CancellationToken)

The GetAccountInfo(CancellationToken) operation returns the sku name and account kind for the specified account.

For more information, see Get Account Information.

(Inherited from BlobBaseClient)
GetAccountInfoAsync(CancellationToken)

The GetAccountInfoAsync(CancellationToken) operation returns the sku name and account kind for the specified account.

For more information, see Get Account Information.

(Inherited from BlobBaseClient)
GetBlobLeaseClientCore(String)

Initializes a new instance of the BlobLeaseClient class.

(Inherited from BlobBaseClient)
GetBlockList(BlockListTypes, String, BlobRequestConditions, CancellationToken)

The GetBlockList(BlockListTypes, String, BlobRequestConditions, CancellationToken) operation operation retrieves the list of blocks that have been uploaded as part of a block blob. There are two block lists maintained for a blob. The Committed Block list has blocks that have been successfully committed to a given blob with CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken). The Uncommitted Block list has blocks that have been uploaded for a blob using Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken), but that have not yet been committed. These blocks are stored in Azure in association with a blob, but do not yet form part of the blob.

GetBlockListAsync(BlockListTypes, String, BlobRequestConditions, CancellationToken)

The GetBlockListAsync(BlockListTypes, String, BlobRequestConditions, CancellationToken) operation operation retrieves the list of blocks that have been uploaded as part of a block blob. There are two block lists maintained for a blob. The Committed Block list has blocks that have been successfully committed to a given blob with CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken). The Uncommitted Block list has blocks that have been uploaded for a blob using Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlockAsync(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken), but that have not yet been committed. These blocks are stored in Azure in association with a blob, but do not yet form part of the blob.

GetParentBlobContainerClientCore()

Create a new BlobContainerClient that pointing to this BlobBaseClient's parent container. The new BlockBlobClient uses the same request policy pipeline as the BlobBaseClient.

(Inherited from BlobBaseClient)
GetProperties(BlobRequestConditions, CancellationToken)

The GetProperties(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.

For more information, see Get Blob Properties.

(Inherited from BlobBaseClient)
GetPropertiesAsync(BlobRequestConditions, CancellationToken)

The GetPropertiesAsync(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.

For more information, see Get Blob Properties.

(Inherited from BlobBaseClient)
GetTags(BlobRequestConditions, CancellationToken)

Gets the tags associated with the underlying blob.

For more information, see Get Blob Tags

(Inherited from BlobBaseClient)
GetTagsAsync(BlobRequestConditions, CancellationToken)

Gets the tags associated with the underlying blob.

For more information, see Get Blob Tags

(Inherited from BlobBaseClient)
OpenRead(BlobOpenReadOptions, CancellationToken)

Opens a stream for reading from the blob. The stream will only download the blob as the stream is read from.

(Inherited from BlobBaseClient)
OpenReadAsync(BlobOpenReadOptions, CancellationToken)

Opens a stream for reading from the blob. The stream will only download the blob as the stream is read from.

(Inherited from BlobBaseClient)
OpenWrite(Boolean, BlockBlobOpenWriteOptions, CancellationToken)

Opens a stream for writing to the blob.

OpenWriteAsync(Boolean, BlockBlobOpenWriteOptions, CancellationToken)

Opens a stream for writing to the blob. If the blob exists, it will be overwritten.

Query(String, BlobQueryOptions, CancellationToken)

The Query(String, BlobQueryOptions, CancellationToken) API returns the result of a query against the blob.

For more information, see Query Blob Contents.

QueryAsync(String, BlobQueryOptions, CancellationToken)

The QueryAsync(String, BlobQueryOptions, CancellationToken) API returns the result of a query against the blob.

For more information, see Query Blob Contents.

SetAccessTier(AccessTier, BlobRequestConditions, Nullable<RehydratePriority>, CancellationToken)

The SetAccessTier(AccessTier, BlobRequestConditions, Nullable<RehydratePriority>, CancellationToken) operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage or general purpose v2 account.

A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag. For detailed information about block blob level tiering Blob Storage Tiers.

For more information about setting the tier, see Blob Storage Tiers.

(Inherited from BlobBaseClient)
SetAccessTierAsync(AccessTier, BlobRequestConditions, Nullable<RehydratePriority>, CancellationToken)

The SetAccessTierAsync(AccessTier, BlobRequestConditions, Nullable<RehydratePriority>, CancellationToken) operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage or general purpose v2 account.

A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag. For detailed information about block blob level tiering Blob Storage Tiers.

For more information about setting the tier, see Blob Storage Tiers.

(Inherited from BlobBaseClient)
SetHttpHeaders(BlobHttpHeaders, BlobRequestConditions, CancellationToken)

The SetHttpHeaders(BlobHttpHeaders, BlobRequestConditions, CancellationToken) operation sets system properties on the blob.

For more information, see Set Blob Properties.

(Inherited from BlobBaseClient)
SetHttpHeadersAsync(BlobHttpHeaders, BlobRequestConditions, CancellationToken)

The SetHttpHeadersAsync(BlobHttpHeaders, BlobRequestConditions, CancellationToken) operation sets system properties on the blob.

For more information, see Set Blob Properties.

(Inherited from BlobBaseClient)
SetImmutabilityPolicy(BlobImmutabilityPolicy, BlobRequestConditions, CancellationToken)

Sets the Immutability Policy on a Blob, Blob Snapshot, or Blob Version. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
SetImmutabilityPolicyAsync(BlobImmutabilityPolicy, BlobRequestConditions, CancellationToken)

Sets the Immutability Policy on a Blob, Blob Snapshot, or Blob Version. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
SetLegalHold(Boolean, CancellationToken)

Sets a legal hold on the blob. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
SetLegalHoldAsync(Boolean, CancellationToken)

Sets a legal hold on the blob. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

(Inherited from BlobBaseClient)
SetMetadata(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

The SetMetadata(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation sets user-defined metadata for the specified blob as one or more name-value pairs.

For more information, see Set Blob Metadata.

(Inherited from BlobBaseClient)
SetMetadataAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

The SetMetadataAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation sets user-defined metadata for the specified blob as one or more name-value pairs.

For more information, see Set Blob Metadata.

(Inherited from BlobBaseClient)
SetTags(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

Sets tags on the underlying blob. A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. Valid tag key and value characters include lower and upper case letters, digits (0-9), space (' '), plus ('+'), minus ('-'), period ('.'), forward slash ('/'), colon (':'), equals ('='), and underscore ('_').

For more information, see Set Blob Tags.

(Inherited from BlobBaseClient)
SetTagsAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken)

Sets tags on the underlying blob. A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. Valid tag key and value characters include lower and upper case letters, digits (0-9), space (' '), plus ('+'), minus ('-'), period ('.'), forward slash ('/'), colon (':'), equals ('='), and underscore ('_').

For more information, see Set Blob Tags.

(Inherited from BlobBaseClient)
StageBlock(String, Stream, BlockBlobStageBlockOptions, CancellationToken)

The StageBlock(String, Stream, BlockBlobStageBlockOptions, CancellationToken) operation creates a new block as part of a block blob's "staging area" to be eventually committed via the CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation.

For more information, see Put Block.

StageBlockAsync(String, Stream, BlockBlobStageBlockOptions, CancellationToken)

The StageBlockAsync(String, Stream, BlockBlobStageBlockOptions, CancellationToken) operation creates a new block as part of a block blob's "staging area" to be eventually committed via the CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operation.

For more information, see Put Block.

StageBlockFromUri(Uri, String, StageBlockFromUriOptions, CancellationToken)

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

For more information, see Put Block From URL.

StageBlockFromUriAsync(Uri, String, StageBlockFromUriOptions, CancellationToken)

The StageBlockFromUriAsync(Uri, String, StageBlockFromUriOptions, CancellationToken) operation creates a new block to be committed as part of a blob where the contents are read from the sourceUri.

For more information, see Put Block From URL.

StartCopyFromUri(Uri, BlobCopyFromUriOptions, CancellationToken)

The StartCopyFromUri(Uri, BlobCopyFromUriOptions, CancellationToken) operation begins an asynchronous copy of the data from the source to this blob. You can check the Azure.Storage.Blobs.Models.BlobProperties.CopyStatus returned from the GetProperties(BlobRequestConditions, CancellationToken) to determine if the copy has completed.

For more information, see Copy Blob.

(Inherited from BlobBaseClient)
StartCopyFromUriAsync(Uri, BlobCopyFromUriOptions, CancellationToken)

The Azure.Storage.Blobs.Specialized.BlobBaseClient.StartCopyFromUri(System.Uri,System.Collections.Generic.IDictionary{System.String,System.String},System.Nullable{Azure.Storage.Blobs.Models.AccessTier},Azure.Storage.Blobs.Models.BlobRequestConditions,Azure.Storage.Blobs.Models.BlobRequestConditions,System.Nullable{Azure.Storage.Blobs.Models.RehydratePriority},System.Threading.CancellationToken) operation begins an asynchronous copy of the data from the source to this blob. You can check the Azure.Storage.Blobs.Models.BlobProperties.CopyStatus returned from the GetPropertiesAsync(BlobRequestConditions, CancellationToken) to determine if the copy has completed.

For more information, see Copy Blob.

(Inherited from BlobBaseClient)
SyncCopyFromUri(Uri, BlobCopyFromUriOptions, CancellationToken)

The Copy Blob From URL operation copies a blob to a destination within the storage account synchronously for source blob sizes up to 256 MiB. This API is available starting in version 2018-03-28. The source for a Copy Blob From URL operation can be any committed block blob in any Azure storage account which is either public or authorized with a shared access signature.

The size of the source blob can be a maximum length of up to 256 MiB.

For more information, see Copy Blob From URL.

(Inherited from BlobBaseClient)
SyncCopyFromUriAsync(Uri, BlobCopyFromUriOptions, CancellationToken)

The Copy Blob From URL operation copies a blob to a destination within the storage account synchronously for source blob sizes up to 256 MiB. This API is available starting in version 2018-03-28. The source for a Copy Blob From URL operation can be any committed block blob in any Azure storage account which is either public or authorized with a shared access signature.

The size of the source blob can be a maximum length of up to 256 MiB.

For more information, see Copy Blob From URL.

(Inherited from BlobBaseClient)
SyncUploadFromUri(Uri, BlobSyncUploadFromUriOptions, CancellationToken)

The Upload from Uri operation creates a new Block Blob where the contents of the blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.

Partial updates are not supported with Put Blob from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial updates to a block blob’s contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.

SyncUploadFromUri(Uri, Boolean, CancellationToken)

The Upload from Uri operation creates a new Block Blob where the contents of the blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.

Partial updates are not supported with Put Blob from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial updates to a block blob’s contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.

SyncUploadFromUriAsync(Uri, BlobSyncUploadFromUriOptions, CancellationToken)

The Upload from Uri operation creates a new Block Blob where the contents of the blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.

Partial updates are not supported with Put Blob from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial updates to a block blob’s contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.

SyncUploadFromUriAsync(Uri, Boolean, CancellationToken)

The Upload from Uri operation creates a new Block Blob where the contents of the blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.

Partial updates are not supported with Put Blob from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial updates to a block blob’s contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.

Undelete(CancellationToken)

The Undelete(CancellationToken) operation restores the contents and metadata of a soft deleted blob and any associated soft deleted snapshots.

For more information, see Undelete Blob.

(Inherited from BlobBaseClient)
UndeleteAsync(CancellationToken)

The UndeleteAsync(CancellationToken) operation restores the contents and metadata of a soft deleted blob and any associated soft deleted snapshots.

For more information, see Undelete Blob.

(Inherited from BlobBaseClient)
Upload(Stream, BlobUploadOptions, CancellationToken)

The Upload(Stream, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.

Set access conditions through Conditions to avoid overwriting existing data.

Partial updates are not supported with Upload(Stream, BlobUploadOptions, CancellationToken); the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken) and CommitBlockList(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operations.

For more information, see Put Blob.

UploadAsync(Stream, BlobUploadOptions, CancellationToken)

The UploadAsync(Stream, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.

Set access conditions through Conditions to avoid overwriting existing data.

Partial updates are not supported with UploadAsync(Stream, BlobUploadOptions, CancellationToken); the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock(System.String,System.IO.Stream,System.Byte[],Azure.Storage.Blobs.Models.BlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken) and CommitBlockListAsync(IEnumerable<String>, CommitBlockListOptions, CancellationToken) operations.

For more information, see Put Blob.

WithCustomerProvidedKey(Nullable<CustomerProvidedKey>)

Initializes a new instance of the BlockBlobClient class with an identical Uri source but the specified customerProvidedKey.

WithEncryptionScope(String)

Initializes a new instance of the BlockBlobClient class with an identical Uri source but the specified encryptionScope.

WithSnapshot(String)

Initializes a new instance of the BlockBlobClient class with an identical Uri source but the specified snapshot timestamp.

For more information, see Create a snapshot of a blob.

WithSnapshotCore(String)

Creates a new instance of the BlockBlobClient class with an identical Uri source but the specified snapshot timestamp.

WithVersion(String)

Initializes a new instance of the BlockBlobClient class with an identical Uri source but the specified versionId timestamp.

Extension Methods

GetBlobLeaseClient(BlobBaseClient, String)

Initializes a new instance of the BlobLeaseClient class.

GetParentBlobContainerClient(BlobBaseClient)

Create a new BlobContainerClient that pointing to this BlobBaseClient's parent container. The new BlockBlobClient uses the same request policy pipeline as the BlobBaseClient.

Applies to