BlobServiceClient.CreateBlobContainerAsync(String, PublicAccessType, IDictionary<String,String>, CancellationToken) Method

Definition

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

For more information, see .

[Azure.Core.ForwardsClientCalls]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.BlobContainerClient>> CreateBlobContainerAsync (string blobContainerName, Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, System.Threading.CancellationToken cancellationToken = null);
abstract member CreateBlobContainerAsync : string * Azure.Storage.Blobs.Models.PublicAccessType * System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.BlobContainerClient>>
override this.CreateBlobContainerAsync : string * Azure.Storage.Blobs.Models.PublicAccessType * System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.BlobContainerClient>>

Parameters

blobContainerName
String

The name of the container to create.

publicAccessType
PublicAccessType

Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies full public read access for container and blob data. Clients can enumerate blobs within the container via anonymous request, but cannot enumerate containers within the storage account. Blob specifies public read access for blobs. Blob data within this container can be read via anonymous request, but container data is not available. Clients cannot enumerate blobs within the container via anonymous request. None specifies that the container data is private to the account owner.

metadata
IDictionary<String,String>

Optional custom metadata to set for this container.

cancellationToken
CancellationToken

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

Returns

A Response<T> referencing the newly created container.

Attributes
Azure.Core.ForwardsClientCallsAttribute

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to