Skip to content

Commit 01b7aae

Browse files
committed
Last minute tweaks
1 parent 013cb5f commit 01b7aae

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

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

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Use Azure CLI for files & ACLs in Azure Data Lake Storage Gen2 (preview)
2+
title: Use Azure CLI for files & ACLs in Azure Data Lake Storage Gen2
33
description: Use the Azure CLI to manage directories and file and directory access control lists (ACL) in storage accounts that have a hierarchical namespace.
44
services: storage
55
author: normesta
@@ -11,14 +11,12 @@ ms.author: normesta
1111
ms.reviewer: prishet
1212
---
1313

14-
# Use Azure CLI to manage directories, files, and ACLs in Azure Data Lake Storage Gen2 (preview)
14+
# Use Azure CLI to manage directories, files, and ACLs in Azure Data Lake Storage Gen2
1515

1616
This article shows you how to use the [Azure Command-Line Interface (CLI)](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest) to create and manage directories, files, and permissions in storage accounts that have a hierarchical namespace.
1717

18-
> [!IMPORTANT]
19-
> The `storage-preview` extension that is featured in this article is currently in public preview.
18+
[Gen1 to Gen2 mapping](https://github.com/Azure/azure-cli-extensions/tree/master/src/storage-preview#mapping-from-adls-gen1-to-adls-gen2) | [Give feedback](https://github.com/Azure/azure-cli-extensions/issues)
2019

21-
[Sample](https://github.com/Azure/azure-cli-extensions/tree/master/src/storage-preview#adls-gen2-support) | [Gen1 to Gen2 mapping](https://github.com/Azure/azure-cli-extensions/tree/master/src/storage-preview#mapping-from-adls-gen1-to-adls-gen2) | [Give feedback](https://github.com/Azure/azure-cli-extensions/issues)
2220
## Prerequisites
2321

2422
> [!div class="checklist"]
@@ -55,7 +53,7 @@ This article shows you how to use the [Azure Command-Line Interface (CLI)](https
5553

5654
Otherwise, open a browser page at [https://aka.ms/devicelogin](https://aka.ms/devicelogin) and enter the authorization code displayed in your terminal. Then, sign in with your account credentials in the browser.
5755

58-
To learn more about different authentication methods, see Sign in with Azure CLI.
56+
To learn more about different authentication methods, see [Authorize access to blob or queue data with Azure CLI](../common/authorize-data-operations-cli.md).
5957

6058
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.
6159

@@ -65,8 +63,8 @@ This article shows you how to use the [Azure Command-Line Interface (CLI)](https
6563

6664
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
6765

68-
> ![!NOTE]
69-
> 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).
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).
7068
7169
## Create a file system
7270

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

133131
```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
132+
az storage fs directory move -n my-directory -f my-file-system --new-directory "my-file-system/my-new-directory" --account-name mystorageaccount
136133
```
137134

138135
This example moves a directory to a file system named `my-second-file-system`.
139136

140137
```azurecli
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
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
143139
```
144140

145141
## Delete a directory
@@ -164,12 +160,12 @@ az storage fs directory exists -n my-directory -f my-file-system --account-name
164160

165161
## Download from a directory
166162

167-
Download a file from a directory by using the `az storage fs directory download` command.
163+
Download a file from a directory by using the `az storage fs file download` command.
168164

169165
This example downloads a file named `upload.txt` from a directory named `my-directory`.
170166

171167
```azurecli
172-
az storage fs directory download -p upload.txt -f my-file-system -d my-directory/upload.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
173169
```
174170

175171
## List directory contents
@@ -189,8 +185,7 @@ Upload a file to a directory by using the `az storage fs directory upload` comma
189185
This example uploads a file named `upload.txt` to a directory named `my-directory`.
190186

191187
```azurecli
192-
az storage fs directory upload -s "C:\mylocaldirectory\upload.txt" \
193-
-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
194189
```
195190

196191
## Show file properties
@@ -208,7 +203,7 @@ Rename or move a file by using the `az storage fs file move` command.
208203
This example renames a file from the name `my-file.txt` to the name `my-file-renamed.txt`.
209204

210205
```azurecli
211-
az storage fs file move -p my-file.txt -f my-file-system -new-path 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
212207
```
213208

214209
## Delete a file
@@ -218,7 +213,7 @@ Delete a file by using the `az storage fs file delete` command.
218213
This example deletes a file named `my-file.txt`
219214

220215
```azurecli
221-
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
222217
```
223218

224219
## Manage permissions
@@ -259,21 +254,21 @@ Use the `az storage fs access set` command to set the ACL of a **directory**.
259254
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.
260255

261256
```azurecli
262-
az storage fs access set -a "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
263258
```
264259

265260
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.
266261

267262
```azurecli
268-
az storage fs access set -a "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
269264
```
270265

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

273268
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.
274269

275270
```azurecli
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
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
277272
```
278273

279274
The following image shows the output after setting the ACL of a file.
@@ -316,7 +311,6 @@ az storage fs access set --owner xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p my-dir
316311

317312
## See also
318313

319-
* [Sample](https://github.com/Azure/azure-cli-extensions/tree/master/src/storage-preview)
320314
* [Gen1 to Gen2 mapping](https://github.com/Azure/azure-cli-extensions/tree/master/src/storage-preview#mapping-from-adls-gen1-to-adls-gen2)
321315
* [Give feedback](https://github.com/Azure/azure-cli-extensions/issues)
322316
* [Known issues](data-lake-storage-known-issues.md#api-scope-data-lake-client-library)

0 commit comments

Comments
 (0)