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-directory-file-acl-cli.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ This article shows you how to use the [Azure Command-Line Interface (CLI)](https
64
64
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
65
65
66
66
> [!NOTE]
67
-
> The example presented in this article reflect account key authorization. If you want to use Azure Active Directory (AD) authorization, either set the **AZURE_STORAGE_AUTH_MODE** environment variable to `login` or append `--auth-mode login` to each of these command examples. To learn more about authorization methods, see [Authorize access to blob or queue data with Azure CLI](../common/authorize-data-operations-cli.md).
67
+
> The example presented in this article show Azure Active Directory (AD) authorization. To learn more about authorization methods, see [Authorize access to blob or queue data with Azure CLI](../common/authorize-data-operations-cli.md).
68
68
69
69
## Create a file system
70
70
@@ -73,15 +73,15 @@ A file system acts as a container for your files. You can create one by using th
73
73
This example creates a file system named `my-file-system`.
74
74
75
75
```azurecli
76
-
az storage fs create -n my-file-system --account-name mystorageaccount
76
+
az storage fs create -n my-file-system --account-name mystorageaccount --auth-mode login
77
77
```
78
78
79
79
## Show file system properties
80
80
81
81
You can print the properties of a file system to the console by using the `az storage fs show` command.
82
82
83
83
```azurecli
84
-
az storage fs show -n my-file-system --account-name mystorageaccount
84
+
az storage fs show -n my-file-system --account-name mystorageaccount --auth-mode login
85
85
```
86
86
87
87
## List file system contents
@@ -91,7 +91,7 @@ List the contents of a directory by using the `az storage fs file list` command.
91
91
This example lists the contents of a file system named `my-file-system`.
92
92
93
93
```azurecli
94
-
az storage fs file list -f my-file-system --account-name mystorageaccount
94
+
az storage fs file list -f my-file-system --account-name mystorageaccount --auth-mode login
95
95
```
96
96
97
97
## Delete a file system
@@ -101,7 +101,7 @@ Delete a file system by using the `az storage fs delete` command.
101
101
This example deletes a file system named `my-file-system`.
102
102
103
103
```azurecli
104
-
az storage fs delete -n my-file-system --account-name mystorageaccount
104
+
az storage fs delete -n my-file-system --account-name mystorageaccount --auth-mode login
105
105
```
106
106
107
107
## Create a directory
@@ -111,15 +111,15 @@ Create a directory reference by using the `az storage fs directory create` comma
111
111
This example adds a directory named `my-directory` to a file system named `my-file-system` that is located in an account named `mystorageaccount`.
@@ -175,7 +175,7 @@ List the contents of a directory by using the `az storage fs file list` command.
175
175
This example lists the contents of a directory named `my-directory` that is located in the `my-file-system` file system of a storage account named `mystorageaccount`.
176
176
177
177
```azurecli
178
-
az storage fs file list -f my-file-system --path my-directory --account-name mystorageaccount
178
+
az storage fs file list -f my-file-system --path my-directory --account-name mystorageaccount --auth-mode login
179
179
```
180
180
181
181
## Upload a file to a directory
@@ -185,15 +185,15 @@ Upload a file to a directory by using the `az storage fs directory upload` comma
185
185
This example uploads a file named `upload.txt` to a directory named `my-directory`.
@@ -230,15 +230,15 @@ Get the ACL of a **directory** by using the `az storage fs access show` command.
230
230
This example gets the ACL of a directory, and then prints the ACL to the console.
231
231
232
232
```azurecli
233
-
az storage fs access show -p my-directory -f my-file-system --account-name mystorageaccount
233
+
az storage fs access show -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
234
234
```
235
235
236
236
Get the access permissions of a **file** by using the `az storage fs access show` command.
237
237
238
238
This example gets the ACL of a file and then prints the ACL to the console.
239
239
240
240
```azurecli
241
-
az storage fs access show -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
241
+
az storage fs access show -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount --auth-mode login
242
242
```
243
243
244
244
The following image shows the output after getting the ACL of a directory.
@@ -254,21 +254,21 @@ Use the `az storage fs access set` command to set the ACL of a **directory**.
254
254
This example sets the ACL on a directory for the owning user, owning group, or other users, and then prints the ACL to the console.
255
255
256
256
```azurecli
257
-
az storage fs access set --acl "user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount
257
+
az storage fs access set --acl "user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
258
258
```
259
259
260
260
This example sets the *default* ACL on a directory for the owning user, owning group, or other users, and then prints the ACL to the console.
261
261
262
262
```azurecli
263
-
az storage fs access set --acl "default:user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount
263
+
az storage fs access set --acl "default:user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
264
264
```
265
265
266
266
Use the `az storage fs access set` command to set the acl of a **file**.
267
267
268
268
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.
269
269
270
270
```azurecli
271
-
az storage fs access set --acl "user::rw-,group::rw-,other::-wx" -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
271
+
az storage fs access set --acl "user::rw-,group::rw-,other::-wx" -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount --auth-mode login
272
272
```
273
273
274
274
The following image shows the output after setting the ACL of a file.
@@ -286,27 +286,27 @@ Update the ACL of a directory or file by setting the `-permissions` parameter to
286
286
This example updates the ACL of a **directory**.
287
287
288
288
```azurecli
289
-
az storage fs access set --permissions rwxrwxrwx -p my-directory -f my-file-system --account-name mystorageaccount
289
+
az storage fs access set --permissions rwxrwxrwx -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
290
290
```
291
291
292
292
This example updates the ACL of a **file**.
293
293
294
294
```azurecli
295
-
az storage fs access set --permissions rwxrwxrwx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
295
+
az storage fs access set --permissions rwxrwxrwx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount --auth-mode login
296
296
```
297
297
298
298
You can also update the owning user and group of a directory or file by setting the `--owner` or `group` parameters to the entity ID or User Principal Name (UPN) of a user.
299
299
300
300
This example changes the owner of a directory.
301
301
302
302
```azurecli
303
-
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory -f my-file-system --account-name mystorageaccount
303
+
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
304
304
```
305
305
306
306
This example changes the owner of a file.
307
307
308
308
```azurecli
309
-
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
309
+
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount --auth-mode login
0 commit comments