az storage directory

Manage directories in Azure file shares.

Commands

Name Description Type Status
az storage directory create

Create a directory in a file share.

Core Preview
az storage directory delete

Delete an empty directory.

Core Preview
az storage directory show

Show the properties of a directory.

Core Preview

az storage directory create

Preview

Create a directory in a file share.

Create a directory in a file share. Nested paths such as parent/child are supported, but the parent directory must already exist.

az storage directory create [--account-key]
                            [--account-name]
                            [--client-request-id]
                            [--metadata]
                            [--name]
                            [--sas-token]
                            [--share-name]
                            [--timeout]
                            [--url]

Examples

Create a directory

az storage directory create --account-name mystorageaccount --account-key $ACCOUNT_KEY --share-name myshare --name mydir

Create a nested directory

az storage directory create --account-name mystorageaccount --account-key $ACCOUNT_KEY --share-name myshare --name mydir/child

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

Storage account key.

--account-name

Storage account name. Used with the share name and directory path when --url is not given.

--client-request-id

An opaque, globally-unique, client-generated string identifier for the request.

--metadata

Metadata in space-separated key=value pairs.

--name

The directory path within the share, e.g. parent/child. The parent must exist.

--sas-token

A shared access signature. Alternative to --account-key.

--share-name

The share name.

--timeout

The timeout parameter is expressed in seconds.

--url

The directory URL. Alternative to --account-name, --share-name and --name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage directory delete

Preview

Delete an empty directory.

Delete a directory from a file share. The directory must be empty.

az storage directory delete [--account-key]
                            [--account-name]
                            [--client-request-id]
                            [--name]
                            [--sas-token]
                            [--share-name]
                            [--timeout]
                            [--url]

Examples

Delete a directory

az storage directory delete --account-name mystorageaccount --account-key $ACCOUNT_KEY --share-name myshare --name mydir

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

Storage account key.

--account-name

Storage account name. Used with the share name and directory path when --url is not given.

--client-request-id

An opaque, globally-unique, client-generated string identifier for the request.

--name

The directory path within the share, e.g. parent/child. The directory must be empty.

--sas-token

A shared access signature. Alternative to --account-key.

--share-name

The share name.

--timeout

The timeout parameter is expressed in seconds.

--url

The directory URL. Alternative to --account-name, --share-name and --name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage directory show

Preview

Show the properties of a directory.

Get the properties and metadata of a directory in a file share.

az storage directory show [--account-key]
                          [--account-name]
                          [--client-request-id]
                          [--name]
                          [--sas-token]
                          [--share-name]
                          [--snapshot]
                          [--timeout]
                          [--url]

Examples

Show a directory

az storage directory show --account-name mystorageaccount --account-key $ACCOUNT_KEY --share-name myshare --name mydir

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

Storage account key.

--account-name

Storage account name. Used with the share name and directory path when --url is not given.

--client-request-id

An opaque, globally-unique, client-generated string identifier for the request.

--name

The directory path within the share, e.g. parent/child.

--sas-token

A shared access signature. Alternative to --account-key.

--share-name

The share name.

--snapshot

The share snapshot to query.

--timeout

The timeout parameter is expressed in seconds.

--url

The directory URL. Alternative to --account-name, --share-name and --name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.