Share via


BlobServiceClient.GetBlobContainers Method

Definition

The GetBlobContainers(BlobContainerTraits, BlobContainerStates, String, CancellationToken) operation returns a sequence of blob containers in the storage account. Enumerating the blob containers may make multiple requests to the service while fetching all the values. Containers are ordered lexicographically by name.

For more information, see List Containers.

public virtual Azure.Pageable<Azure.Storage.Blobs.Models.BlobContainerItem> GetBlobContainers (Azure.Storage.Blobs.Models.BlobContainerTraits traits = Azure.Storage.Blobs.Models.BlobContainerTraits.None, Azure.Storage.Blobs.Models.BlobContainerStates states = Azure.Storage.Blobs.Models.BlobContainerStates.None, string prefix = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetBlobContainers : Azure.Storage.Blobs.Models.BlobContainerTraits * Azure.Storage.Blobs.Models.BlobContainerStates * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Storage.Blobs.Models.BlobContainerItem>
override this.GetBlobContainers : Azure.Storage.Blobs.Models.BlobContainerTraits * Azure.Storage.Blobs.Models.BlobContainerStates * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Storage.Blobs.Models.BlobContainerItem>
Public Overridable Function GetBlobContainers (Optional traits As BlobContainerTraits = Azure.Storage.Blobs.Models.BlobContainerTraits.None, Optional states As BlobContainerStates = Azure.Storage.Blobs.Models.BlobContainerStates.None, Optional prefix As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of BlobContainerItem)

Parameters

traits
BlobContainerTraits

Specifies trait options for shaping the blob containers.

states
BlobContainerStates

Specifies state options for shaping the blob containers.

prefix
String

Specifies a string that filters the results to return only containers whose name begins with the specified prefix.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

An IEnumerable<T> of Response<T> describing the blob containers in the storage account.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to