BlobBaseClient Class

Definition

The BlobBaseClient allows you to manipulate Azure Storage blobs.

public class BlobBaseClient
type BlobBaseClient = class
Public Class BlobBaseClient
Inheritance
BlobBaseClient
Derived

Constructors

BlobBaseClient()

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(String, String, String)

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(String, String, String, BlobClientOptions)

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(Uri, AzureSasCredential, BlobClientOptions)

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(Uri, BlobClientOptions)

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(Uri, StorageSharedKeyCredential, BlobClientOptions)

Initializes a new instance of the BlobBaseClient class.

BlobBaseClient(Uri, TokenCredential, BlobClientOptions)

Initializes a new instance of the BlobBaseClient class.

Properties

AccountName

Gets the Storage account name corresponding to the blob client.

BlobContainerName

Gets the container name corresponding to the blob client.

CanGenerateSasUri

Determines whether the client is able to generate a SAS. If the client is authenticated with a StorageSharedKeyCredential.

Name

Gets the name of the blob.

Uri

Gets the blob's primary Uri endpoint.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

DownloadContent()

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

For more information, see Get Blob.

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.

DownloadContent(CancellationToken)

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

For more information, see Get Blob.

DownloadContentAsync()

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

For more information, see Get Blob.

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.

DownloadContentAsync(CancellationToken)

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

For more information, see Get Blob.

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.

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.

DownloadTo(Stream)

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

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.

DownloadTo(Stream, CancellationToken)

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

DownloadTo(String)

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

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.

DownloadTo(String, CancellationToken)

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

DownloadToAsync(Stream)

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

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.

DownloadToAsync(Stream, CancellationToken)

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

DownloadToAsync(String)

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

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.

DownloadToAsync(String, CancellationToken)

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

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.

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.

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.

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.

GetBlobLeaseClientCore(String)

Initializes a new instance of the BlobLeaseClient class.

GetCopyAuthorizationHeaderAsync(BlobBaseClient, CancellationToken)

Get a BlobBaseClient's HttpAuthorization for passing the authorization when performing service to service copy where OAuth is necessary to authenticate the source.

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.

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.

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.

GetTags(BlobRequestConditions, CancellationToken)

Gets the tags associated with the underlying blob.

For more information, see Get Blob Tags

GetTagsAsync(BlobRequestConditions, CancellationToken)

Gets the tags associated with the underlying blob.

For more information, see Get Blob Tags

OpenRead(BlobOpenReadOptions, CancellationToken)

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

OpenReadAsync(BlobOpenReadOptions, CancellationToken)

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

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.

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.

SetHttpHeaders(BlobHttpHeaders, BlobRequestConditions, CancellationToken)

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

For more information, see Set Blob Properties.

SetHttpHeadersAsync(BlobHttpHeaders, BlobRequestConditions, CancellationToken)

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

For more information, see Set Blob Properties.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

WithCustomerProvidedKey(Nullable<CustomerProvidedKey>)

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

WithEncryptionScope(String)

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

WithSnapshot(String)

Initializes a new instance of the BlobBaseClient 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 BlobBaseClient class with an identical Uri source but the specified snapshot timestamp.

WithVersion(String)

Initializes a new instance of the BlobBaseClient 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