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
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.
The access tier of the share.
| Property | Value |
|---|---|
| Accepted values: | TransactionOptimized, Hot, Cool, Premium |
Storage account key.
Storage account name. Used with the share name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
The protocol to enable for the share.
| Property | Value |
|---|---|
| Accepted values: | SMB, NFS |
Metadata in space-separated key=value pairs.
The share name.
The maximum size of the share in GiB.
Root squashing behavior on the share. Only valid for NFS shares.
| Property | Value |
|---|---|
| Accepted values: | NoRootSquash, RootSquash, AllSquash |
A shared access signature. Alternative to --account-key.
The timeout parameter is expressed in seconds.
The share URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az storage share delete
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.
Storage account key.
Storage account name. Used with the share name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
Also delete the share's snapshots. Required when the share has snapshots.
| Property | Value |
|---|---|
| Accepted values: | include, include-leased |
If specified, the operation only succeeds if the share's lease is active and matches this ID.
The share name.
A shared access signature. Alternative to --account-key.
Delete only this share snapshot.
The timeout parameter is expressed in seconds.
The share URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az storage share list
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.
Storage account key.
Storage account name. Used when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
An opaque string value that identifies the portion of the result set to return with this operation.
Specifies the maximum number of shares to return.
Filters the results to return only shares whose name begins with the specified prefix.
A shared access signature. Alternative to --account-key.
The timeout parameter is expressed in seconds.
The file service URL. Alternative to --account-name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az storage share show
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.
Storage account key.
Storage account name. Used with the share name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
If specified, the operation only succeeds if the share's lease is active and matches this ID.
The share name.
A shared access signature. Alternative to --account-key.
The share snapshot to query.
The timeout parameter is expressed in seconds.
The share URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az storage share update
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.
The access tier of the share.
| Property | Value |
|---|---|
| Accepted values: | TransactionOptimized, Hot, Cool, Premium |
Storage account key.
Storage account name. Used with the share name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
If specified, the operation only succeeds if the share's lease is active and matches this ID.
The share name.
The maximum size of the share in GiB.
Root squashing behavior on the share. Only valid for NFS shares.
| Property | Value |
|---|---|
| Accepted values: | NoRootSquash, RootSquash, AllSquash |
A shared access signature. Alternative to --account-key.
The timeout parameter is expressed in seconds.
The share URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.