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/data-lake-storage-acl-cli.md
+2-4Lines changed: 2 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: normesta
7
7
8
8
ms.service: azure-data-lake-storage
9
9
ms.topic: how-to
10
-
ms.date: 06/09/2023
10
+
ms.date: 11/18/2024
11
11
ms.author: normesta
12
12
ms.reviewer: prishet
13
13
ms.devlang: azurecli
@@ -36,8 +36,6 @@ ACL inheritance is already available for new child items that are created under
36
36
37
37
- Owning user of the target container or directory to which you plan to apply ACL settings. To set ACLs recursively, this includes all child items in the target container or directory.
38
38
39
-
- Storage account key.
40
-
41
39
## Ensure that you have the correct version of Azure CLI installed
42
40
43
41
1. Open the [Azure Cloud Shell](../../cloud-shell/overview.md), or if you've [installed](/cli/azure/install-azure-cli) the Azure CLI locally, open a command console application such as Windows PowerShell.
@@ -64,7 +62,7 @@ ACL inheritance is already available for new child items that are created under
64
62
65
63
To learn more about different authentication methods, see [Authorize access to blob or queue data with Azure CLI](./authorize-data-operations-cli.md).
66
64
67
-
2. If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that will host your static website.
65
+
2. If your identity is associated with more than one subscription, and you are not prompted to select the subscription, then set your active subscription to subscription of the storage account that you want operate upon. In this example, replace the `<subscription-id>` placeholder value with the ID of your subscription.
Copy file name to clipboardExpand all lines: articles/storage/blobs/data-lake-storage-acl-powershell.md
+13-34Lines changed: 13 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: normesta
6
6
7
7
ms.service: azure-data-lake-storage
8
8
ms.topic: how-to
9
-
ms.date: 02/17/2021
9
+
ms.date: 11/18/2024
10
10
ms.author: normesta
11
11
ms.reviewer: prishet
12
12
ms.devlang: powershell
@@ -35,8 +35,6 @@ ACL inheritance is already available for new child items that are created under
35
35
36
36
- Owning user of the target container or directory to which you plan to apply ACL settings. To set ACLs recursively, this includes all child items in the target container or directory.
37
37
38
-
- Storage account key.
39
-
40
38
## Install the PowerShell module
41
39
42
40
1. Verify that the version of PowerShell that have installed is `5.1` or higher by using the following command.
@@ -57,24 +55,13 @@ ACL inheritance is already available for new child items that are created under
57
55
58
56
## Connect to the account
59
57
60
-
Choose how you want your commands to obtain authorization to the storage account.
### Option 1: Obtain authorization by using Microsoft Entra ID
65
-
66
-
> [!NOTE]
67
-
> If you're using Microsoft Entra ID to authorize access, then make sure that your security principal has been assigned the [Storage Blob Data Owner role](../../role-based-access-control/built-in-roles.md#storage-blob-data-owner). To learn more about how ACL permissions are applied and the effects of changing them, see [Access control model in Azure Data Lake Storage](./data-lake-storage-access-control-model.md).
68
-
69
-
With this approach, the system ensures that your user account has the appropriate Azure role-based access control (Azure RBAC) assignments and ACL permissions.
70
-
71
-
1. Open a Windows PowerShell command window, and then sign in to your Azure subscription with the `Connect-AzAccount` command and follow the on-screen directions.
58
+
1. Open a Windows PowerShell command window, and then sign in to your Azure subscription with the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) command and follow the on-screen directions.
72
59
73
60
```powershell
74
61
Connect-AzAccount
75
62
```
76
63
77
-
2. If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that you want create and manage directories in. In this example, replace the `<subscription-id>` placeholder value with the ID of your subscription.
64
+
2. If your identity is associated with more than one subscription, and you are not prompted to select the subscription, then set your active subscription to subscription of the storage account that you want operate upon. In this example, replace the `<subscription-id>` placeholder value with the ID of your subscription.
Get the ACL of a directory or file by using the `Get-AzDataLakeGen2Item`cmdlet.
78
+
Get the ACL of a directory or file by using the [Get-AzDataLakeGen2Item](/powershell/module/az.storage/get-azdatalakegen2item)cmdlet.
100
79
101
80
This example gets the ACL of the root directory of a **container** and then prints the ACL to the console.
102
81
@@ -142,7 +121,7 @@ This section shows you how to:
142
121
143
122
### Set an ACL
144
123
145
-
Use the `Set-AzDataLakeGen2ItemAclObject` cmdlet to create an ACL for the owning user, owning group, or other users. Then, use the`Update-AzDataLakeGen2Item` cmdlet to commit the ACL.
124
+
Use the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject) cmdlet to create an ACL for the owning user, owning group, or other users. Then, use the[Update-AzDataLakeGen2Item](/powershell/module/az.storage/update-azdatalakegen2item) cmdlet to commit the ACL.
146
125
147
126
This example sets the ACL on the root directory of a **container** for the owning user, owning group, or other users, and then prints the ACL to the console.
148
127
@@ -170,7 +149,7 @@ $dir.ACL
170
149
```
171
150
172
151
> [!NOTE]
173
-
> If you want to set a **default** ACL entry, use the **-DefaultScope** parameter when you run the **Set-AzDataLakeGen2ItemAclObject** command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope`.
152
+
> If you want to set a **default** ACL entry, use the **-DefaultScope** parameter when you run the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject) command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope`.
174
153
175
154
This example sets the ACL on a **file** for the owning user, owning group, or other users, and then prints the ACL to the console.
176
155
@@ -196,7 +175,7 @@ In this example, the owning user and owning group have only read and write permi
196
175
197
176
### Set ACLs recursively
198
177
199
-
Set ACLs recursively by using the **Set-AzDataLakeGen2AclRecursive** cmdlet.
178
+
Set ACLs recursively by using the [Set-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/set-azdatalakegen2aclrecursive) cmdlet.
200
179
201
180
This example sets the ACL of a directory named `my-parent-directory`. These entries give the owning user read, write, and execute permissions, gives the owning group only read and execute permissions, and gives all others no access. The last ACL entry in this example gives a specific user with the object ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" read and execute permissions.
> If you want to set a **default** ACL entry, use the **-DefaultScope** parameter when you run the **Set-AzDataLakeGen2ItemAclObject** command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope`.
197
+
> If you want to set a **default** ACL entry, use the **-DefaultScope** parameter when you run the [Set-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/set-azdatalakegen2aclrecursive) command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope`.
219
198
220
199
To see an example that sets ACLs recursively in batches by specifying a batch size, see the [Set-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/set-azdatalakegen2aclrecursive) reference article.
221
200
@@ -230,7 +209,7 @@ This section shows you how to:
230
209
231
210
### Update an ACL
232
211
233
-
First, get the ACL. Then, use the `Set-AzDataLakeGen2ItemAclObject` cmdlet to add or update an ACL entry. Use the `Update-AzDataLakeGen2Item` cmdlet to commit the ACL.
212
+
First, get the ACL. Then, use the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject) cmdlet to add or update an ACL entry. Use the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject)` cmdlet to commit the ACL.
234
213
235
214
This example creates or updates the ACL on a **directory** for a user.
> If you want to update a **default** ACL entry, use the **-DefaultScope** parameter when you run the **Set-AzDataLakeGen2ItemAclObject** command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityID xxxxxxxx-xxxx-xxxxxxxxxxx -Permission r-x -DefaultScope`.
225
+
> If you want to update a **default** ACL entry, use the **-DefaultScope** parameter when you run the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject)* command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityID xxxxxxxx-xxxx-xxxxxxxxxxx -Permission r-x -DefaultScope`.
247
226
248
227
### Update ACLs recursively
249
228
250
-
Update ACLs recursively by using the **Update-AzDataLakeGen2AclRecursive** cmdlet.
229
+
Update ACLs recursively by using the [Update-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/update-azdatalakegen2aclrecursive) cmdlet.
251
230
252
231
This example updates an ACL entry with write permission.
You can remove one or more ACL entries recursively. To remove an ACL entry, create a new ACL object for ACL entry to be removed, and then use that object in remove ACL operation. Do not get the existing ACL, just provide the ACL entries to be removed.
301
280
302
-
Remove ACL entries by using the **Remove-AzDataLakeGen2AclRecursive** cmdlet.
281
+
Remove ACL entries by using the [Remove-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/remove-azdatalakegen2aclrecursive) cmdlet.
303
282
304
283
This example removes an ACL entry from the root directory of the container.
> If you want to remove a **default** ACL entry, use the **-DefaultScope** parameter when you run the **Set-AzDataLakeGen2ItemAclObject** command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $userID -Permission "---" -DefaultScope`.
295
+
> If you want to remove a **default** ACL entry, use the **-DefaultScope** parameter when you run the [Set-AzDataLakeGen2ItemAclObject](/powershell/module/az.storage/set-azdatalakegen2itemaclobject) command. For example: `$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $userID -Permission "---" -DefaultScope`.
317
296
318
297
To see an example that removes ACLs recursively in batches by specifying a batch size, see the [Remove-AzDataLakeGen2AclRecursive](/powershell/module/az.storage/remove-azdatalakegen2aclrecursive) reference article.
Copy file name to clipboardExpand all lines: articles/storage/blobs/data-lake-storage-directory-file-acl-cli.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: normesta
7
7
8
8
ms.service: azure-data-lake-storage
9
9
ms.topic: how-to
10
-
ms.date: 02/17/2021
10
+
ms.date: 11/18/2024
11
11
ms.author: normesta
12
12
ms.reviewer: prishet
13
13
ms.devlang: azurecli
@@ -56,20 +56,21 @@ To learn about how to get, set, and update the access control lists (ACL) of dir
56
56
57
57
To learn more about different authentication methods, see [Authorize access to blob or queue data with Azure CLI](./authorize-data-operations-cli.md).
58
58
59
-
2. If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that will host your static website.
59
+
2. If your identity is associated with more than one subscription, and you are not prompted to select the subscription, then set your active subscription to subscription of the storage account that you want operate upon. In this example, replace the `<subscription-id>` placeholder value with the ID of your subscription.
60
60
61
61
```azurecli
62
62
az account set --subscription <subscription-id>
63
63
```
64
64
65
65
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
66
+
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
66
67
67
68
> [!NOTE]
68
69
> The example presented in this article show Microsoft Entra authorization. To learn more about authorization methods, see [Authorize access to blob or queue data with Azure CLI](./authorize-data-operations-cli.md).
69
70
70
71
## Create a container
71
72
72
-
A container acts as a file system for your files. You can create one by using the `az storage fs create` command.
73
+
A container acts as a file system for your files. You can create one by using the [az storage fs create](/cli/azure/storage/fs#az-storage-fs-create) command.
73
74
74
75
This example creates a container named `my-file-system`.
You can print the properties of a directory to the console by using the `az storage fs directory show` command.
121
+
You can print the properties of a directory to the console by using the [az storage fs directory show](/cli/azure/storage/fs/directory#az-storage-fs-directory-show) command.
121
122
122
123
```azurecli
123
124
az storage fs directory show -n my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
124
125
```
125
126
126
127
## Rename or move a directory
127
128
128
-
Rename or move a directory by using the `az storage fs directory move` command.
129
+
Rename or move a directory by using the [az storage fs directory move](/cli/azure/storage/fs/directory#az-storage-fs-directory-move) command.
129
130
130
131
This example renames a directory from the name `my-directory` to the name `my-new-directory` in the same container.
Determine if a specific directory exists in the container by using the `az storage fs directory exists` command.
155
+
Determine if a specific directory exists in the container by using the [az storage fs directory exists](/cli/azure/storage/fs/directory#az-storage-fs-directory-exists) command.
155
156
156
157
This example reveals whether a directory named `my-directory` exists in the `my-file-system` container.
List the contents of a directory by using the `az storage fs file list` command.
175
+
List the contents of a directory by using the [az storage fs file list](/cli/azure/storage/fs/file#az-storage-fs-file-list) command.
175
176
176
177
This example lists the contents of a directory named `my-directory` that is located in the `my-file-system` container of a storage account named `mystorageaccount`.
177
178
@@ -181,7 +182,7 @@ az storage fs file list -f my-file-system --path my-directory --account-name mys
181
182
182
183
## Upload a file to a directory
183
184
184
-
Upload a file to a directory by using the `az storage fs file upload` command.
185
+
Upload a file to a directory by using the [az storage fs file upload](/cli/azure/storage/fs/file#az-storage-fs-file-upload) command.
185
186
186
187
This example uploads a file named `upload.txt` to a directory named `my-directory`.
You can print the properties of a file to the console by using the `az storage fs file show` command.
195
+
You can print the properties of a file to the console by using the [az storage fs file show](/cli/azure/storage/fs/file#az-storage-fs-file-show) command.
195
196
196
197
```azurecli
197
198
az storage fs file show -p my-file.txt -f my-file-system --account-name mystorageaccount --auth-mode login
198
199
```
199
200
200
201
## Rename or move a file
201
202
202
-
Rename or move a file by using the `az storage fs file move` command.
203
+
Rename or move a file by using the [az storage fs file move](/cli/azure/storage/fs/file#az-storage-fs-file-move) command.
203
204
204
205
This example renames a file from the name `my-file.txt` to the name `my-file-renamed.txt`.
0 commit comments