Skip to content

Commit 013cb5f

Browse files
committed
updated draft for the latest GA of CLI
1 parent 2141bc3 commit 013cb5f

File tree

1 file changed

+71
-72
lines changed

1 file changed

+71
-72
lines changed

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

Lines changed: 71 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: normesta
66
ms.service: storage
77
ms.subservice: data-lake-storage-gen2
88
ms.topic: conceptual
9-
ms.date: 11/24/2019
9+
ms.date: 05/08/2020
1010
ms.author: normesta
1111
ms.reviewer: prishet
1212
---
@@ -80,132 +80,145 @@ az storage fs create -n my-file-system --account-name mystorageaccount
8080

8181
## Show file system properties
8282

83-
// put here.
83+
You can print the properties of a file system to the console by using the `az storage fs show` command.
8484

85-
## Show file system properties
86-
87-
// put here.
85+
```azurecli
86+
az storage fs show -n my-file-system --account-name mystorageaccount
87+
```
8888

8989
## List file system contents
9090

91-
// put here.
91+
List the contents of a directory by using the `az storage fs file list` command.
92+
93+
This example lists the contents of a file system named `my-file-system`.
94+
95+
```azurecli
96+
az storage fs file list -f my-file-system --account-name mystorageaccount
97+
```
98+
99+
## Delete a file system
100+
101+
Delete a file system by using the `az storage fs delete` command.
102+
103+
This example deletes a file system named `my-file-system`.
104+
105+
```azurecli
106+
az storage fs delete -n my-file-system --account-name mystorageaccount
107+
```
92108

93109
## Create a directory
94110

95-
Create a directory reference by using the `az storage blob directory create` command.
111+
Create a directory reference by using the `az storage fs directory create` command.
96112

97113
This example adds a directory named `my-directory` to a file system named `my-file-system` that is located in an account named `mystorageaccount`.
98114

99115
```azurecli
100-
az storage blob directory create -c my-file-system -d my-directory --account-name mystorageaccount
116+
az storage fs directory create -n my-directory -f my-file-system --account-name mystorageaccount
101117
```
102118

103119
## Show directory properties
104120

105-
You can print the properties of a directory to the console by using the `az storage blob show` command.
121+
You can print the properties of a directory to the console by using the `az storage fs directory show` command.
106122

107123
```azurecli
108-
az storage blob directory show -c my-file-system -d my-directory --account-name mystorageaccount
124+
az storage fs directory show -n my-directory -f my-file-system --account-name mystorageaccount
109125
```
110126

111127
## Rename or move a directory
112128

113-
Rename or move a directory by using the `az storage blob directory move` command.
129+
Rename or move a directory by using the `az storage fs directory move` command.
130+
131+
This example renames a directory from the name `my-directory` to the name `my-new-directory` in the same file system.
132+
133+
```azurecli
134+
az storage fs directory move -n my-directory -f my-file-system \
135+
-new-directory "my-file-system/my-new-directory" --account-name mystorageaccount
136+
```
114137

115-
This example renames a directory from the name `my-directory` to the name `my-new-directory`.
138+
This example moves a directory to a file system named `my-second-file-system`.
116139

117140
```azurecli
118-
az storage blob directory move -c my-file-system -d my-new-directory -s my-directory --account-name mystorageaccount
141+
az storage fs directory move -n my-directory -f my-file-system \
142+
-new-directory "my-second-file-system/my-new-directory" --account-name mystorageaccount
119143
```
120144

121145
## Delete a directory
122146

123-
Delete a directory by using the `az storage blob directory delete` command.
147+
Delete a directory by using the `az storage fs directory delete` command.
124148

125149
This example deletes a directory named `my-directory`.
126150

127151
```azurecli
128-
az storage blob directory delete -c my-file-system -d my-directory --account-name mystorageaccount
152+
az storage fs directory delete -n my-directory -f my-file-system --account-name mystorageaccount
129153
```
130154

131155
## Check if a directory exists
132156

133-
Determine if a specific directory exists in the file system by using the `az storage blob directory exist` command.
157+
Determine if a specific directory exists in the file system by using the `az storage fs directory exists` command.
134158

135159
This example reveals whether a directory named `my-directory` exists in the `my-file-system` file system.
136160

137161
```azurecli
138-
az storage blob directory exists -c my-file-system -d my-directory --account-name mystorageaccount
162+
az storage fs directory exists -n my-directory -f my-file-system --account-name mystorageaccount
139163
```
140164

141165
## Download from a directory
142166

143-
Download a file from a directory by using the `az storage blob directory download` command.
167+
Download a file from a directory by using the `az storage fs directory download` command.
144168

145169
This example downloads a file named `upload.txt` from a directory named `my-directory`.
146170

147171
```azurecli
148-
az storage blob directory download -c my-file-system --account-name mystorageaccount -s "my-directory/upload.txt" -d "C:\mylocalfolder\download.txt"
149-
```
150-
151-
This example downloads an entire directory.
152-
153-
```azurecli
154-
az storage blob directory download -c my-file-system --account-name mystorageaccount -s "my-directory/" -d "C:\mylocalfolder" --recursive
172+
az storage fs directory download -p upload.txt -f my-file-system -d my-directory/upload.txt --account-name mystorageaccount
155173
```
156174

157175
## List directory contents
158176

159-
List the contents of a directory by using the `az storage blob directory list` command.
177+
List the contents of a directory by using the `az storage fs file list` command.
160178

161179
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`.
162180

163181
```azurecli
164-
az storage blob directory list -c my-file-system -d my-directory --account-name mystorageaccount
182+
az storage fs file list -f my-file-system --path my-directory --account-name mystorageaccount
165183
```
166184

167185
## Upload a file to a directory
168186

169-
Upload a file to a directory by using the `az storage blob directory upload` command.
187+
Upload a file to a directory by using the `az storage fs directory upload` command.
170188

171189
This example uploads a file named `upload.txt` to a directory named `my-directory`.
172190

173191
```azurecli
174-
az storage blob directory upload -c my-file-system --account-name mystorageaccount -s "C:\mylocaldirectory\upload.txt" -d my-directory
175-
```
176-
177-
This example uploads an entire directory.
178-
179-
```azurecli
180-
az storage blob directory upload -c my-file-system --account-name mystorageaccount -s "C:\mylocaldirectory\" -d my-directory --recursive
192+
az storage fs directory upload -s "C:\mylocaldirectory\upload.txt" \
193+
-p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
181194
```
182195

183196
## Show file properties
184197

185-
You can print the properties of a file to the console by using the `az storage blob show` command.
198+
You can print the properties of a file to the console by using the `az storage fs file show` command.
186199

187200
```azurecli
188-
az storage blob show -c my-file-system -b my-file.txt --account-name mystorageaccount
201+
az storage fs file show -p my-file.txt -f my-file-system --account-name mystorageaccount
189202
```
190203

191204
## Rename or move a file
192205

193-
Rename or move a file by using the `az storage blob move` command.
206+
Rename or move a file by using the `az storage fs file move` command.
194207

195208
This example renames a file from the name `my-file.txt` to the name `my-file-renamed.txt`.
196209

197210
```azurecli
198-
az storage blob move -c my-file-system -d my-file-renamed.txt -s my-file.txt --account-name mystorageaccount
211+
az storage fs file move -p my-file.txt -f my-file-system -new-path my-file-renamed.txt --account-name mystorageaccount
199212
```
200213

201214
## Delete a file
202215

203-
Delete a file by using the `az storage blob delete` command.
216+
Delete a file by using the `az storage fs file delete` command.
204217

205218
This example deletes a file named `my-file.txt`
206219

207220
```azurecli
208-
az storage blob delete -c my-file-system -b my-file.txt --account-name mystorageaccount
221+
az storage fs file delete -p my-directory/my-file.txt-f my-file-system --account-name mystorageaccount
209222
```
210223

211224
## Manage permissions
@@ -215,22 +228,22 @@ You can get, set, and update access permissions of directories and files.
215228
> [!NOTE]
216229
> If you're using Azure Active Directory (Azure AD) to authorize commands, then make sure that your security principal has been assigned the [Storage Blob Data Owner role](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner). To learn more about how ACL permissions are applied and the effects of changing them, see [Access control in Azure Data Lake Storage Gen2](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-access-control).
217230
218-
### Get directory and file permissions
231+
### Get an ACL
219232

220-
Get the ACL of a **directory** by using the `az storage blob directory access show` command.
233+
Get the ACL of a **directory** by using the `az storage fs access show` command.
221234

222235
This example gets the ACL of a directory, and then prints the ACL to the console.
223236

224237
```azurecli
225-
az storage blob directory access show -d my-directory -c my-file-system --account-name mystorageaccount
238+
az storage fs access show -p my-directory -f my-file-system --account-name mystorageaccount
226239
```
227240

228-
Get the access permissions of a **file** by using the `az storage blob access show` command.
241+
Get the access permissions of a **file** by using the `az storage fs access show` command.
229242

230243
This example gets the ACL of a file and then prints the ACL to the console.
231244

232245
```azurecli
233-
az storage blob access show -b my-directory/upload.txt -c my-file-system --account-name mystorageaccount
246+
az storage fs access show -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
234247
```
235248

236249
The following image shows the output after getting the ACL of a directory.
@@ -239,29 +252,30 @@ The following image shows the output after getting the ACL of a directory.
239252

240253
In this example, the owning user has read, write, and execute permissions. The owning group has only read and execute permissions. For more information about access control lists, see [Access control in Azure Data Lake Storage Gen2](data-lake-storage-access-control.md).
241254

242-
### Set directory and file permissions
255+
### Set an ACL
243256

244-
Use the `az storage blob directory access set` command to set the ACL of a **directory**.
257+
Use the `az storage fs access set` command to set the ACL of a **directory**.
245258

246259
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.
247260

248261
```azurecli
249-
az storage blob directory access set -a "user::rw-,group::rw-,other::-wx" -d my-directory -c my-file-system --account-name mystorageaccount
262+
az storage fs access set -a "user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount
250263
```
251264

252265
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.
253266

254267
```azurecli
255-
az storage blob directory access set -a "default:user::rw-,group::rw-,other::-wx" -d my-directory -c my-file-system --account-name mystorageaccount
268+
az storage fs access set -a "default:user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount
256269
```
257270

258-
Use the `az storage blob access set` command to set the acl of a **file**.
271+
Use the `az storage fs access set` command to set the acl of a **file**.
259272

260273
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.
261274

262275
```azurecli
263-
az storage blob access set -a "user::rw-,group::rw-,other::-wx" -b my-directory/upload.txt -c my-file-system --account-name mystorageaccount
276+
az storage fs access set -a "user::rw-,group::rw-,other::-wx" -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
264277
```
278+
265279
The following image shows the output after setting the ACL of a file.
266280

267281
![Get ACL output](./media/data-lake-storage-directory-file-acl-cli/set-acl-file.png)
@@ -270,49 +284,34 @@ In this example, the owning user and owning group have only read and write permi
270284

271285
### Update directory and file permissions
272286

273-
Another way to set this permission is to use the `az storage blob directory access update` or `az storage blob access update` command.
287+
Another way to set this permission is to use the `az storage fs access set` command.
274288

275289
Update the ACL of a directory or file by setting the `-permissions` parameter to the short form of an ACL.
276290

277291
This example updates the ACL of a **directory**.
278292

279293
```azurecli
280-
az storage blob directory access update --permissions "rwxrwxrwx" -d my-directory -c my-file-system --account-name mystorageaccount
294+
az storage fs access set --permissions rwxrwxrwx -p my-directory -f my-file-system --account-name mystorageaccount
281295
```
282296

283297
This example updates the ACL of a **file**.
284298

285299
```azurecli
286-
az storage blob access update --permissions "rwxrwxrwx" -b my-directory/upload.txt -c my-file-system --account-name mystorageaccount
300+
az storage fs access set --permissions rwxrwxrwx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
287301
```
288302

289303
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.
290304

291305
This example changes the owner of a directory.
292306

293307
```azurecli
294-
az storage blob directory access update --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -d my-directory -c my-file-system --account-name mystorageaccount
308+
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory -f my-file-system --account-name mystorageaccount
295309
```
296310

297311
This example changes the owner of a file.
298312

299313
```azurecli
300-
az storage blob access update --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -b my-directory/upload.txt -c my-file-system --account-name mystorageaccount
301-
```
302-
## Manage user-defined metadata
303-
304-
You can add user-defined metadata to a file or directory by using the `az storage blob directory metadata update` command with one or more name-value pairs.
305-
306-
This example adds user-defined metadata for a directory named `my-directory` directory.
307-
308-
```azurecli
309-
az storage blob directory metadata update --metadata tag1=value1 tag2=value2 -c my-file-system -d my-directory --account-name mystorageaccount
310-
```
311-
312-
This example shows all user-defined metadata for directory named `my-directory`.
313-
314-
```azurecli
315-
az storage blob directory metadata show -c my-file-system -d my-directory --account-name mystorageaccount
314+
az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-directory/upload.txt -f my-file-system --account-name mystorageaccount
316315
```
317316

318317
## See also

0 commit comments

Comments
 (0)