az storage share

Manage Azure file shares.

Commands

Name Description Type Status
az storage share create

Create a file share.

Core Preview
az storage share delete

Delete a file share.

Core Preview
az storage share list

List file shares in a storage account.

Core Preview
az storage share show

Show the properties of a file share.

Core Preview
az storage share update

Update the properties of a file share.

Core Preview

az storage share create

Preview

Create a file share.

Create a file share in a storage account. Use --quota to set the maximum share size in GiB.

az storage share create [--access-tier {TransactionOptimized, Hot, Cool, Premium}]
                        [--account-key]
                        [--account-name]
                        [--client-request-id]
                        [--enabled-protocols {SMB, NFS}]
                        [--metadata]
                        [--name]
                        [--quota]
                        [--root-squash {NoRootSquash, RootSquash, AllSquash}]
                        [--sas-token]
                        [--timeout]
                        [--url]

Examples

Create a file share

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

Create a file share with a 100 GiB quota

az storage share create --account-name mystorageaccount --account-key $ACCOUNT_KEY --name myshare --quota 100

Optional Parameters

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

--access-tier

The access tier of the share.

Property Value
Accepted values: TransactionOptimized, Hot, Cool, Premium
--account-key

Storage account key.

--account-name

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

--client-request-id

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

--enabled-protocols

The protocol to enable for the share.

Property Value
Accepted values: SMB, NFS
--metadata

Metadata in space-separated key=value pairs.

--name

The share name.

--quota

The maximum size of the share in GiB.

--root-squash

Root squashing behavior on the share. Only valid for NFS shares.

Property Value
Accepted values: NoRootSquash, RootSquash, AllSquash
--sas-token

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

--timeout

The timeout parameter is expressed in seconds.

--url

The share URL. Alternative to --account-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 share delete

Preview

Delete a file share.

Delete a file share and all its contents. If the share has snapshots, pass --delete-snapshots include to delete them too, or use --snapshot to delete a single snapshot.

az storage share delete [--account-key]
                        [--account-name]
                        [--client-request-id]
                        [--delete-snapshots {include, include-leased}]
                        [--lease-id]
                        [--name]
                        [--sas-token]
                        [--snapshot]
                        [--timeout]
                        [--url]

Examples

Delete a file share

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

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 when --url is not given.

--client-request-id

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

--delete-snapshots

Also delete the share's snapshots. Required when the share has snapshots.

Property Value
Accepted values: include, include-leased
--lease-id

If specified, the operation only succeeds if the share's lease is active and matches this ID.

--name

The share name.

--sas-token

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

--snapshot

Delete only this share snapshot.

--timeout

The timeout parameter is expressed in seconds.

--url

The share URL. Alternative to --account-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 share list

Preview

List file shares in a storage account.

List the file shares in a storage account, following continuation markers until all pages are returned. Use --prefix to filter by name.

az storage share list [--account-key]
                      [--account-name]
                      [--client-request-id]
                      [--marker]
                      [--maxresults]
                      [--prefix]
                      [--sas-token]
                      [--timeout]
                      [--url]

Examples

List file shares

az storage share list --account-name mystorageaccount --account-key $ACCOUNT_KEY

List file shares whose names start with a prefix

az storage share list --account-name mystorageaccount --account-key $ACCOUNT_KEY --prefix logs

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 when --url is not given.

--client-request-id

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

--marker

An opaque string value that identifies the portion of the result set to return with this operation.

--maxresults

Specifies the maximum number of shares to return.

--prefix

Filters the results to return only shares whose name begins with the specified prefix.

--sas-token

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

--timeout

The timeout parameter is expressed in seconds.

--url

The file service URL. Alternative to --account-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 share show

Preview

Show the properties of a file share.

Get the properties and metadata of a file share, such as its quota, access tier, and last-modified time. Use --snapshot to read a share snapshot.

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

Examples

Show a file share

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

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 when --url is not given.

--client-request-id

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

--lease-id

If specified, the operation only succeeds if the share's lease is active and matches this ID.

--name

The share name.

--sas-token

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

--snapshot

The share snapshot to query.

--timeout

The timeout parameter is expressed in seconds.

--url

The share URL. Alternative to --account-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 share update

Preview

Update the properties of a file share.

Update the quota, access tier, or root squash setting of a file share.

az storage share update [--access-tier {TransactionOptimized, Hot, Cool, Premium}]
                        [--account-key]
                        [--account-name]
                        [--client-request-id]
                        [--lease-id]
                        [--name]
                        [--quota]
                        [--root-squash {NoRootSquash, RootSquash, AllSquash}]
                        [--sas-token]
                        [--timeout]
                        [--url]

Examples

Set the quota of a file share

az storage share update --account-name mystorageaccount --account-key $ACCOUNT_KEY --name myshare --quota 200

Optional Parameters

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

--access-tier

The access tier of the share.

Property Value
Accepted values: TransactionOptimized, Hot, Cool, Premium
--account-key

Storage account key.

--account-name

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

--client-request-id

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

--lease-id

If specified, the operation only succeeds if the share's lease is active and matches this ID.

--name

The share name.

--quota

The maximum size of the share in GiB.

--root-squash

Root squashing behavior on the share. Only valid for NFS shares.

Property Value
Accepted values: NoRootSquash, RootSquash, AllSquash
--sas-token

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

--timeout

The timeout parameter is expressed in seconds.

--url

The share URL. Alternative to --account-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.