BlobContainerClient Class

Definition

The BlobContainerClient allows you to manipulate Azure Storage containers and their blobs.

public class BlobContainerClient
type BlobContainerClient = class
Public Class BlobContainerClient
Inheritance
BlobContainerClient

Constructors

BlobContainerClient()

Initializes a new instance of the BlobContainerClient class for mocking.

BlobContainerClient(String, String)

Initializes a new instance of the BlobContainerClient class.

BlobContainerClient(String, String, BlobClientOptions)

Initializes a new instance of the BlobContainerClient class.

BlobContainerClient(Uri, AzureSasCredential, BlobClientOptions)

Initializes a new instance of the BlobContainerClient class.

BlobContainerClient(Uri, BlobClientOptions)

Initializes a new instance of the BlobContainerClient class.

BlobContainerClient(Uri, StorageSharedKeyCredential, BlobClientOptions)

Initializes a new instance of the BlobContainerClient class.

BlobContainerClient(Uri, TokenCredential, BlobClientOptions)

Initializes a new instance of the BlobContainerClient class.

Fields

LogsBlobContainerName

The Azure Storage name used to identify a storage account's logs container.

RootBlobContainerName

The Azure Storage name used to identify a storage account's root container.

WebBlobContainerName

The Azure Storage name used to identify a storage account's web content container.

Properties

AccountName

Gets the Storage account name corresponding to the container 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 container.

Uri

Gets the container's primary Uri endpoint.

Methods

Create(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)

The Create(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.

For more information, see Create Container.

CreateAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)

The CreateAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.

For more information, see Create Container.

CreateClient(Uri, BlobClientOptions, HttpPipeline)

Initializes a new instance of the BlobContainerClient class.

CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)

The CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.

For more information, see Create Container.

CreateIfNotExistsAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)

The CreateIfNotExistsAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.

For more information, see Create Container.

Delete(BlobRequestConditions, CancellationToken)

The Delete(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.

For more information, see Delete Container.

DeleteAsync(BlobRequestConditions, CancellationToken)

The DeleteAsync(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.

For more information, see Delete Container.

DeleteBlob(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteBlob(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.

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.

DeleteBlobAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteBlobAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.

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.

DeleteBlobIfExists(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteBlobIfExists(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob or snapshot exists. The blob is later deleted during garbage collection.

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.

DeleteBlobIfExistsAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)

The DeleteBlobIfExistsAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob or snapshot exists. The blob is later deleted during garbage collection.

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(BlobRequestConditions, CancellationToken)

The DeleteIfExists(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion if it exists. The container and any blobs contained within it are later deleted during garbage collection.

For more information, see Delete Container.

DeleteIfExistsAsync(BlobRequestConditions, CancellationToken)

The DeleteIfExistsAsync(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion if it exists. The container and any blobs contained within it are later deleted during garbage collection.

For more information, see Delete Container.

Exists(CancellationToken)

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

ExistsAsync(CancellationToken)

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

GenerateSasUri(BlobContainerSasPermissions, DateTimeOffset)

The GenerateSasUri(BlobContainerSasPermissions, DateTimeOffset) returns a Uri that generates a Blob Container 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.

GenerateSasUri(BlobSasBuilder)

The GenerateSasUri(BlobSasBuilder) returns a Uri that generates a Blob Container Service Shared Access Signature (SAS) Uri based on the Client properties and builder 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.

GetAccessPolicy(BlobRequestConditions, CancellationToken)

The GetAccessPolicy(BlobRequestConditions, CancellationToken) operation gets the permissions for this container. The permissions indicate whether container data may be accessed publicly.

For more information, see Get Container ACL.

GetAccessPolicyAsync(BlobRequestConditions, CancellationToken)

The GetAccessPolicyAsync(BlobRequestConditions, CancellationToken) operation gets the permissions for this container. The permissions indicate whether container data may be accessed publicly.

For more information, see Get Container ACL.

GetAppendBlobClientCore(String)

Create a new AppendBlobClient object by concatenating blobName to the end of the Uri. The new AppendBlobClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobBaseClientCore(String)

Create a new BlobBaseClient object by appending blobName to the end of Uri. The new BlobBaseClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobClient(String)

Create a new BlobClient object by appending blobName to the end of Uri. The new BlobClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobLeaseClientCore(String)

Initializes a new instance of the BlobLeaseClient class.

GetBlobs(BlobTraits, BlobStates, String, CancellationToken)

The GetBlobs(BlobTraits, BlobStates, String, CancellationToken) operation returns an async sequence of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name.

For more information, see List Blobs.

GetBlobsAsync(BlobTraits, BlobStates, String, CancellationToken)

The GetBlobsAsync(BlobTraits, BlobStates, String, CancellationToken) operation returns an async sequence of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name.

For more information, see List Blobs.

GetBlobsByHierarchy(BlobTraits, BlobStates, String, String, CancellationToken)

The GetBlobsByHierarchy(BlobTraits, BlobStates, String, String, CancellationToken) operation returns an async collection of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name. A delimiter can be used to traverse a virtual hierarchy of blobs as though it were a file system.

For more information, see List Blobs.

GetBlobsByHierarchyAsync(BlobTraits, BlobStates, String, String, CancellationToken)

The GetBlobsByHierarchyAsync(BlobTraits, BlobStates, String, String, CancellationToken) operation returns an async collection of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name. A delimiter can be used to traverse a virtual hierarchy of blobs as though it were a file system.

For more information, see List Blobs.

GetBlockBlobClientCore(String)

Create a new BlockBlobClient object by concatenating blobName to the end of the Uri. The new BlockBlobClient uses the same request policy pipeline as the BlobContainerClient.

GetPageBlobClientCore(String)

Create a new PageBlobClient object by concatenating blobName to the end of the Uri. The new PageBlobClient uses the same request policy pipeline as the BlobContainerClient.

GetParentBlobServiceClientCore()

Create a new BlobServiceClient that pointing to this BlobContainerClient's blob service. The new BlobServiceClient uses the same request policy pipeline as the BlobContainerClient.

GetProperties(BlobRequestConditions, CancellationToken)

The GetProperties(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.

For more information, see Get Container Properties.

GetPropertiesAsync(BlobRequestConditions, CancellationToken)

The GetPropertiesAsync(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.

For more information, see Get Container Properties.

SetAccessPolicy(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken)

The SetAccessPolicy(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken) operation sets the permissions for the specified container. The permissions indicate whether blob container data may be accessed publicly.

For more information, see Set Container ACL.

SetAccessPolicyAsync(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken)

The SetAccessPolicyAsync(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken) operation sets the permissions for the specified container. The permissions indicate whether blob container data may be accessed publicly.

For more information, see Set Container ACL.

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

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

For more information, see Set Container Metadata.

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

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

For more information, see Set Container Metadata.

UploadBlob(String, BinaryData, CancellationToken)

The UploadBlob(String, BinaryData, CancellationToken) operation creates a new block blob.

For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.

For more information, see Put Blob.

UploadBlob(String, Stream, CancellationToken)

The UploadBlob(String, Stream, CancellationToken) operation creates a new block blob.

For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.

For more information, see Put Blob.

UploadBlobAsync(String, BinaryData, CancellationToken)

The UploadBlobAsync(String, BinaryData, CancellationToken) operation creates a new block blob.

For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.

For more information, see Put Blob.

UploadBlobAsync(String, Stream, CancellationToken)

The UploadBlobAsync(String, Stream, CancellationToken) operation creates a new block blob.

For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.

For more information, see Put Blob.

Extension Methods

GetAppendBlobClient(BlobContainerClient, String)

Create a new AppendBlobClient object by concatenating blobName to the end of the client's Uri. The new AppendBlobClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobBaseClient(BlobContainerClient, String)

Create a new BlobBaseClient object by concatenating blobName to the end of the client's Uri. The new BlobBaseClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobBatchClient(BlobContainerClient)

Create a new BlobBatchClient object for the container associated with the BlobContainerClient. The new BlobBatchClient uses the same request policy pipeline as the BlobContainerClient.

GetBlobLeaseClient(BlobContainerClient, String)

Initializes a new instance of the BlobLeaseClient class.

GetBlockBlobClient(BlobContainerClient, String)

Create a new BlockBlobClient object by concatenating blobName to the end of the client's Uri. The new BlockBlobClient uses the same request policy pipeline as the BlobContainerClient.

GetParentBlobServiceClient(BlobContainerClient)

Create a new BlobServiceClient that pointing to this BlobContainerClient's blob service. The new BlobServiceClient uses the same request policy pipeline as the BlobContainerClient.

Applies to