You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-manage-access-to-resources.md
+40-4Lines changed: 40 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: tamram
7
7
8
8
ms.service: storage
9
9
ms.topic: how-to
10
-
ms.date: 12/04/2019
10
+
ms.date: 05/05/2020
11
11
ms.author: tamram
12
12
ms.reviewer: cbrooks
13
13
---
@@ -47,6 +47,16 @@ The following screenshot shows how to change the public access level for the sel
47
47
48
48
### Set container public access level with .NET
49
49
50
+
# [\.NET v12 SDK](#tab/dotnet)
51
+
52
+
To set permissions for a container, call the [BlobContainerClient.SetAccessPolicy](https://docs.microsoft.com/dotnet/api/azure.storage.blobs.blobcontainerclient.setaccesspolicy?view=azure-dotnet) method.
53
+
54
+
The following example sets the container's permissions to full public read access. To set permissions to public read access for blobs only, pass the **PublicAccessType.Blob** field into the [BlobContainerClient.SetAccessPolicy](https://docs.microsoft.com/dotnet/api/azure.storage.blobs.blobcontainerclient.setaccesspolicy?view=azure-dotnet) method. To remove all permissions for anonymous users, use the **BlobContainerPublicAccessType.None** field.
To set permissions for a container using the Azure Storage client library for .NET, first retrieve the container's existing permissions by calling one of the following methods:
@@ -72,6 +82,8 @@ private static async Task SetPublicContainerPermissions(CloudBlobContainer conta
72
82
}
73
83
```
74
84
85
+
---
86
+
75
87
## Access containers and blobs anonymously
76
88
77
89
A client that accesses containers and blobs anonymously can use constructors that do not require credentials. The following examples show a few different ways to reference containers and blobs anonymously.
@@ -80,6 +92,12 @@ A client that accesses containers and blobs anonymously can use constructors tha
80
92
81
93
You can create a new service client object for anonymous access by providing the Blob storage endpoint for the account. However, you must also know the name of a container in that account that's available for anonymous access.
0 commit comments