Skip to content

Commit 6e467dd

Browse files
committed
Final tweaks
1 parent 01b7aae commit 6e467dd

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

articles/storage/blobs/data-lake-storage-directory-file-acl-cli.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This article shows you how to use the [Azure Command-Line Interface (CLI)](https
6464
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
6565

6666
> [!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).
6868
6969
## Create a file system
7070

@@ -73,15 +73,15 @@ A file system acts as a container for your files. You can create one by using th
7373
This example creates a file system named `my-file-system`.
7474

7575
```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
7777
```
7878

7979
## Show file system properties
8080

8181
You can print the properties of a file system to the console by using the `az storage fs show` command.
8282

8383
```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
8585
```
8686

8787
## List file system contents
@@ -91,7 +91,7 @@ List the contents of a directory by using the `az storage fs file list` command.
9191
This example lists the contents of a file system named `my-file-system`.
9292

9393
```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
9595
```
9696

9797
## Delete a file system
@@ -101,7 +101,7 @@ Delete a file system by using the `az storage fs delete` command.
101101
This example deletes a file system named `my-file-system`.
102102

103103
```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
105105
```
106106

107107
## Create a directory
@@ -111,15 +111,15 @@ Create a directory reference by using the `az storage fs directory create` comma
111111
This example adds a directory named `my-directory` to a file system named `my-file-system` that is located in an account named `mystorageaccount`.
112112

113113
```azurecli
114-
az storage fs directory create -n my-directory -f my-file-system --account-name mystorageaccount
114+
az storage fs directory create -n my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
115115
```
116116

117117
## Show directory properties
118118

119119
You can print the properties of a directory to the console by using the `az storage fs directory show` command.
120120

121121
```azurecli
122-
az storage fs directory show -n my-directory -f my-file-system --account-name mystorageaccount
122+
az storage fs directory show -n my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
123123
```
124124

125125
## Rename or move a directory
@@ -129,13 +129,13 @@ Rename or move a directory by using the `az storage fs directory move` command.
129129
This example renames a directory from the name `my-directory` to the name `my-new-directory` in the same file system.
130130

131131
```azurecli
132-
az storage fs directory move -n my-directory -f my-file-system --new-directory "my-file-system/my-new-directory" --account-name mystorageaccount
132+
az storage fs directory move -n my-directory -f my-file-system --new-directory "my-file-system/my-new-directory" --account-name mystorageaccount --auth-mode login
133133
```
134134

135135
This example moves a directory to a file system named `my-second-file-system`.
136136

137137
```azurecli
138-
az storage fs directory move -n my-directory -f my-file-system --new-directory "my-second-file-system/my-new-directory" --account-name mystorageaccount
138+
az storage fs directory move -n my-directory -f my-file-system --new-directory "my-second-file-system/my-new-directory" --account-name mystorageaccount --auth-mode login
139139
```
140140

141141
## Delete a directory
@@ -145,7 +145,7 @@ Delete a directory by using the `az storage fs directory delete` command.
145145
This example deletes a directory named `my-directory`.
146146

147147
```azurecli
148-
az storage fs directory delete -n my-directory -f my-file-system --account-name mystorageaccount
148+
az storage fs directory delete -n my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
149149
```
150150

151151
## Check if a directory exists
@@ -155,7 +155,7 @@ Determine if a specific directory exists in the file system by using the `az sto
155155
This example reveals whether a directory named `my-directory` exists in the `my-file-system` file system.
156156

157157
```azurecli
158-
az storage fs directory exists -n my-directory -f my-file-system --account-name mystorageaccount
158+
az storage fs directory exists -n my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
159159
```
160160

161161
## Download from a directory
@@ -165,7 +165,7 @@ Download a file from a directory by using the `az storage fs file download` comm
165165
This example downloads a file named `upload.txt` from a directory named `my-directory`.
166166

167167
```azurecli
168-
az storage fs file download -p my-directory/upload.txt -f my-file-system -d "C:\myFolder\download.txt" --account-name mystorageaccount
168+
az storage fs file download -p my-directory/upload.txt -f my-file-system -d "C:\myFolder\download.txt" --account-name mystorageaccount --auth-mode login
169169
```
170170

171171
## List directory contents
@@ -175,7 +175,7 @@ List the contents of a directory by using the `az storage fs file list` command.
175175
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`.
176176

177177
```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
179179
```
180180

181181
## 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
185185
This example uploads a file named `upload.txt` to a directory named `my-directory`.
186186

187187
```azurecli
188-
az storage fs file upload -s "C:\myFolder\upload.txt" -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
188+
az storage fs file upload -s "C:\myFolder\upload.txt" -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount --auth-mode login
189189
```
190190

191191
## Show file properties
192192

193193
You can print the properties of a file to the console by using the `az storage fs file show` command.
194194

195195
```azurecli
196-
az storage fs file show -p my-file.txt -f my-file-system --account-name mystorageaccount
196+
az storage fs file show -p my-file.txt -f my-file-system --account-name mystorageaccount --auth-mode login
197197
```
198198

199199
## Rename or move a file
@@ -203,7 +203,7 @@ Rename or move a file by using the `az storage fs file move` command.
203203
This example renames a file from the name `my-file.txt` to the name `my-file-renamed.txt`.
204204

205205
```azurecli
206-
az storage fs file move -p my-file.txt -f my-file-system --new-path my-file-system/my-file-renamed.txt --account-name mystorageaccount
206+
az storage fs file move -p my-file.txt -f my-file-system --new-path my-file-system/my-file-renamed.txt --account-name mystorageaccount --auth-mode login
207207
```
208208

209209
## Delete a file
@@ -213,7 +213,7 @@ Delete a file by using the `az storage fs file delete` command.
213213
This example deletes a file named `my-file.txt`
214214

215215
```azurecli
216-
az storage fs file delete -p my-directory/my-file.txt -f my-file-system --account-name mystorageaccount
216+
az storage fs file delete -p my-directory/my-file.txt -f my-file-system --account-name mystorageaccount --auth-mode login
217217
```
218218

219219
## Manage permissions
@@ -230,15 +230,15 @@ Get the ACL of a **directory** by using the `az storage fs access show` command.
230230
This example gets the ACL of a directory, and then prints the ACL to the console.
231231

232232
```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
234234
```
235235

236236
Get the access permissions of a **file** by using the `az storage fs access show` command.
237237

238238
This example gets the ACL of a file and then prints the ACL to the console.
239239

240240
```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
242242
```
243243

244244
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**.
254254
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.
255255

256256
```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
258258
```
259259

260260
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.
261261

262262
```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
264264
```
265265

266266
Use the `az storage fs access set` command to set the acl of a **file**.
267267

268268
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.
269269

270270
```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
272272
```
273273

274274
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
286286
This example updates the ACL of a **directory**.
287287

288288
```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
290290
```
291291

292292
This example updates the ACL of a **file**.
293293

294294
```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
296296
```
297297

298298
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.
299299

300300
This example changes the owner of a directory.
301301

302302
```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
304304
```
305305

306306
This example changes the owner of a file.
307307

308308
```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
310310
```
311311

312312
## See also

0 commit comments

Comments
 (0)