Skip to content

Azure CLI storage preview extension 2.0.9 readme

Zunli Hu edited this page Nov 11, 2019 · 2 revisions

Overview

This storage-preview extension 2.0.9 is published with ADLS Gen2 filesystem operations support in az storage blob directory command group. This includes:

  1. New directory level operations (create/delete/download/exists/list/move/show/upload/metadata show/metadata update) for both hierarchical namespace enabled (HNS) storage accounts and HNS disabled storage accounts. For HNS enabled accounts, the move/delete operations are atomic.
  2. Permission related operations (access set/access show/access update) for hierarchical namespace enabled (HNS) accounts.

In addition, you can use existing storage blob commands for your ADLS Gen2 account.

ADLS Gen1 ADLS Gen2
az dls fs az storage blob directory
az dls fs access az storage blob directory access
az dls fs access remove-all NO
az dls fs access remove-entry NO
az dls fs access set az storage blob directory access set
az dls fs access set-entry NO
az dls fs access set-owner az storage blob directory access update
az dls fs access set-permission az storage blob directory access update
az dls fs access show az storage blob directory access show
az dls fs append NO
az dls fs create az storage blob directory create
az dls fs delete az storage blob directory delete
az dls fs download az storage blob directory download
az dls fs join NO
az dls fs list az storage blob directory list
az dls fs move az storage blob directory move
az dls fs preview NO
az dls fs remove-expiry NO
az dls fs set-expiry NO
az dls fs show az storage blob directory show
az dls fs test az storage blob directory exists
az dls fs upload az storage blob directory upload
NO az storage blob directory metadata show
NO az storage blob directory metadata update

New commands for existing blob command group

  • az storage blob move
  • az storage blob access
  • az storage blob access set
  • az storage blob access update
  • az storage blob access show

Install Instructions for storage-preview

Install this extension using the below CLI command

az extension add --name storage-preview

Note: Please make sure storage-preview version >= 2.0.9 with azure cli >= 2.0.67. If not, please install upgrade azure-cli version and use az extension update -n storage-preview to upgrade storage-preview extension.

Command Instructions for CLI Sample

Set the access control properties of a directory

az storage blob directory access set -a "user::rwx,group::r--,other::---" -d MyDirectoryPath -c MyContainer --account-name MyStorageAccount

Show the access control properties of a directory

az storage blob directory access show -d MyDirectoryPath -c MyContainer --account-name MyStorageAccount

Update the access permissions of a directory

az storage blob directory access update --permissions "rwxrwxrwx" -d MyDirectoryPath -c MyContainer --account-name MyStorageAccount

Update the owning user of a directory

az storage blob directory access update --owner [entity id or UPN] -d MyDirectoryPath -c MyContainer --account-name MyStorageAccount

Update the owning group of a directory

az storage blob directory access update --group [entity id or UPN] -d MyDirectoryPath -c MyContainer --account-name MyStorageAccount

Create a storage blob directory in a storage container

az storage blob directory create -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

Delete a storage blob directory in a storage container

This operation's behavior is different depending on whether Hierarchical Namespace
is enabled; if yes, then the delete operation can be atomic and instantaneous;
if not, the operation is performed in batches and a continuation token could be returned.

az storage blob directory delete -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

Download a single blob in a storage blob directory

az storage blob directory download -c MyContainer --account-name MyStorageAccount -s "path/to/blob" -d ""

Download the entire directory in a storage container

az storage blob directory download -c MyContainer --account-name MyStorageAccount -s SourceDirectoryPath -d "" --recursive

Download an entire subdirectory of a storage blob directory

az storage blob directory download -c MyContainer --account-name MyStorageAccount -s "path/to/subdirectory" -d "" --recursive

Check for the existence of a blob directory in a storage container

az storage blob directory exists -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

List blobs and blob subdirectories in a storage directory

az storage blob directory list -c MyContainer -d DestinationDirectoryPath --account-name MyStorageAccount

Show all user-defined metadata for the specified blob directory

az storage blob directory metadata show -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

Set user-defined metadata for the specified blob directory as one or more name-value pairs

az storage blob directory metadata update --metadata tag1=value1 -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

Move a storage directory to another storage blob directory in a storage container

Move a storage directory and all its content (which can contain other directories or blobs) to another storage
blob directory in a storage container. This operation's behavior is different depending on whether Hierarchical
Namespace is enabled; if yes, the move operation is atomic and no marker is returned; if not, the operation is
performed in batches and a continuation token could be returned.

az storage blob directory move -c MyContainer -d DestinationDirectoryPath -s SourceDirectoryPath --account-name MyStorageAccount

Show a storage blob directory properties in a storage container

az storage blob directory show -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount

Upload a single blob to a storage blob directory

az storage blob directory upload -c MyContainer --account-name MyStorageAccount -s "path/to/file" -d directory

Upload a directory to a container

az storage blob directory upload -c MyContainer --account-name MyStorageAccount -s "path/to/directory" -d directory --recursive

Update the access permissions of a blob

az storage blob access update --permissions "rwxrwxrwx" -b MyBlob -c MyContainer --account-name MyStorageAccount

Update the owning user of a blob

az storage blob access update --owner [entity id or UPN] -b MyBlob -c MyContainer --account-name MyStorageAccount

Update the owning group of a blob

az storage blob access update --group [entity id or UPN] -b MyBlob -c MyContainer --account-name MyStorageAccount

Move a blob in a storage container

az storage blob move -c MyContainer -d DestinationBlobPath -s SourceBlobPath --account-name MyStorageAccount

Clone this wiki locally