Sdílet prostřednictvím


BlobServiceClient.GetBlobContainersAsync Method

Definition

The GetBlobContainersAsync(BlobContainerTraits, BlobContainerStates, String, CancellationToken) operation returns an async 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.AsyncPageable<Azure.Storage.Blobs.Models.BlobContainerItem> GetBlobContainersAsync (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 GetBlobContainersAsync : Azure.Storage.Blobs.Models.BlobContainerTraits * Azure.Storage.Blobs.Models.BlobContainerStates * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobContainerItem>
override this.GetBlobContainersAsync : Azure.Storage.Blobs.Models.BlobContainerTraits * Azure.Storage.Blobs.Models.BlobContainerStates * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobContainerItem>
Public Overridable Function GetBlobContainersAsync (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 AsyncPageable(Of BlobContainerItem)

Parameters

traits
BlobContainerTraits

Specifies trait options for shaping the blob containers.

states
BlobContainerStates

Specifies states 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 AsyncPageable<T> describing the containers in the storage account.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to