BlobContainerClient.SetAccessPolicyAsync(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken) Method

Definition

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.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> SetAccessPolicyAsync (Azure.Storage.Blobs.Models.PublicAccessType accessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IEnumerable<Azure.Storage.Blobs.Models.BlobSignedIdentifier> permissions = default, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetAccessPolicyAsync : Azure.Storage.Blobs.Models.PublicAccessType * seq<Azure.Storage.Blobs.Models.BlobSignedIdentifier> * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>>
override this.SetAccessPolicyAsync : Azure.Storage.Blobs.Models.PublicAccessType * seq<Azure.Storage.Blobs.Models.BlobSignedIdentifier> * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>>
Public Overridable Function SetAccessPolicyAsync (Optional accessType As PublicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, Optional permissions As IEnumerable(Of BlobSignedIdentifier) = Nothing, Optional conditions As BlobRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BlobContainerInfo))

Parameters

accessType
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.

permissions
System.Collections.Generic.IEnumerable<BlobSignedIdentifier>

Stored access policies that you can use to provide fine grained control over container permissions.

conditions
BlobRequestConditions

Optional BlobRequestConditions to add conditions on setting this blob container's access policy.

cancellationToken
System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Response<BlobContainerInfo>>

A Response<T> describing the updated container.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to