BlobContainerPermissions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the permissions for a container.
public sealed class BlobContainerPermissions
type BlobContainerPermissions = class
Public NotInheritable Class BlobContainerPermissions
- Inheritance
-
BlobContainerPermissions
Examples
// If we want to set the permissions on a container, first we should get the existing permissions.
// This is important, because "SetPermissions" uses "replace" semantics, not "merge" semantics.
// If we skipped this step and just created a new BlobContainerPermissions object locally,
// any existing policies would be deleted.
BlobContainerPermissions permissions = containerWithSharedKey.GetPermissions();
// Create a policy with read access.
SharedAccessBlobPolicy policy = new SharedAccessBlobPolicy()
{
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
Permissions = SharedAccessBlobPermissions.Read
};
// Once uploaded, these permissions will allow SAS tokens created with the named policy
// to read from the container for 30 minutes, as specified in the policy.
// This only applies to SAS tokens created referencing this specific policy name on this specific container.
permissions.SharedAccessPolicies[policyName] = policy;
// This call actually uploads the permissions to the Azure Storage Service.
// Note that this can take up to 30 seconds after the call completes to take affect.
containerWithSharedKey.SetPermissions(permissions);
Constructors
BlobContainerPermissions() |
Initializes a new instance of the BlobContainerPermissions class. |
Properties
PublicAccess |
Gets or sets the public access setting for the container. |
SharedAccessPolicies |
Gets the set of shared access policies for the container. |
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure SDK for .NET