az storage share-rm
Manage Azure file shares using the Microsoft.Storage resource provider.
Commands
Name | Description | Type | Status |
---|---|---|---|
az storage share-rm create |
Create a new Azure file share under the specified storage account. |
Core | GA |
az storage share-rm delete |
Delete the specified Azure file share or share snapshot. |
Core | GA |
az storage share-rm exists |
Check for the existence of an Azure file share. |
Core | GA |
az storage share-rm list |
List the Azure file shares under the specified storage account. |
Core | GA |
az storage share-rm restore |
Restore a file share within a valid retention days if share soft delete is enabled. |
Core | GA |
az storage share-rm show |
Show the properties for a specified Azure file share or share snapshot. |
Core | GA |
az storage share-rm snapshot |
Create a snapshot of an existing share under the specified account. |
Core | Preview |
az storage share-rm stats |
Get the usage bytes of the data stored on the share. |
Core | GA |
az storage share-rm update |
Update the properties for an Azure file share. |
Core | GA |
az storage share-rm create
Create a new Azure file share under the specified storage account.
az storage share-rm create --name
--storage-account
[--access-tier {Cool, Hot, Premium, TransactionOptimized}]
[--enabled-protocols {NFS, SMB}]
[--metadata]
[--quota]
[--resource-group]
[--root-squash {AllSquash, NoRootSquash, RootSquash}]
Examples
Create a new Azure file share 'myfileshare' with metadata and quota as 10 GB under the storage account 'mystorageaccount'(account name) in resource group 'MyResourceGroup'.
az storage share-rm create -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 10 --metadata key1=value1 key2=value2
Create a new Azure file share 'myfileshare' with metadata and quota as 6000 GB under the storage account 'mystorageaccount'(account name) which enables large file share in resource group 'MyResourceGroup'.
az storage account update -g MyResourceGroup --name mystorageaccount --enable-large-file-share
az storage share-rm create -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 6000 --metadata key1=value1 key2=value2
Create a new Azure file share 'myfileshare' with metadata and quota as 10 GB under the storage account 'mystorageaccount' (account id).
az storage share-rm create --storage-account mystorageaccount --name myfileshare --quota 10 --metadata key1=value1 key2=value2
Required Parameters
The file share name.
The name or ID of the storage account.
Optional Parameters
Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
Immutable property for file shares protocol. NFS protocol will be only available for premium file shares (file shares in the FileStorage account type).
Metadata in space-separated key=value pairs that is associated with the share. This overwrites any existing metadata.
The maximum size of the share in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Reduction of the access rights for the remote superuser.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm delete
Delete the specified Azure file share or share snapshot.
BREAKING CHANGE: Snapshot can not be deleted by default and we have added a new parameter to use if you want to include sanpshots for delete operation.
az storage share-rm delete [--ids]
[--include]
[--name]
[--resource-group]
[--snapshot]
[--storage-account]
[--subscription]
[--yes]
Examples
Delete an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account name) in resource group 'MyResourceGroup'.
az storage share-rm delete -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Delete an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account id).
az storage share-rm delete --storage-account mystorageaccount --name myfileshare
Delete an Azure file share by resource id.
az storage share-rm delete --ids file-share-id
Delete an Azure file share snapshot.
az storage share-rm delete --ids file-share-id --snapshot "2021-03-25T05:29:56.0000000Z"
Delete an Azure file share and all its snapshots.
az storage share-rm delete --include snapshots -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Delete an Azure file share and all its snapshots (leased/unleased).
az storage share-rm delete --include leased-snapshots -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails. Default value is None.
The file share name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The DateTime value that specifies the share snapshot to retrieve.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm exists
Check for the existence of an Azure file share.
az storage share-rm exists [--ids]
[--name]
[--resource-group]
[--storage-account]
[--subscription]
Examples
Check for the existence of an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account name) in resource group 'MyResourceGroup'.
az storage share-rm exists -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Check for the existence of an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account id).
az storage share-rm exists --storage-account mystorageaccount --name myfileshare
Check for the existence of an Azure file share by resource id.
az storage share-rm exists --ids file-share-id
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The file share name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm list
List the Azure file shares under the specified storage account.
az storage share-rm list --storage-account
[--include-deleted]
[--include-snapshot]
[--resource-group]
Examples
List the Azure file shares under the storage account 'mystorageaccount' (account name) in resource group 'MyResourceGroup'.
az storage share-rm list -g MyResourceGroup --storage-account mystorageaccount
List the Azure file shares under the storage account 'mystorageaccount' (account id).
az storage share-rm list --storage-account mystorageaccount
List all file shares include deleted under the storage account 'mystorageaccount' .
az storage share-rm list --storage-account mystorageaccount --include-deleted
List all file shares include its all snapshots under the storage account 'mystorageaccount' .
az storage share-rm list --storage-account mystorageaccount --include-snapshot
List all file shares include its all snapshots and deleted file shares under the storage account 'mystorageaccount' .
az storage share-rm list --storage-account mystorageaccount --include-deleted --include-snapshot
Required Parameters
The name or ID of the storage account.
Optional Parameters
Include soft deleted file shares when specified.
Include file share snapshots when specified.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm restore
Restore a file share within a valid retention days if share soft delete is enabled.
az storage share-rm restore --deleted-version
[--ids]
[--name]
[--resource-group]
[--restored-name]
[--storage-account]
[--subscription]
Examples
Restore a file share within a valid retention days if share soft delete is enabled.
az storage share-rm restore -n deletedshare --deleted-version 01D64EB9886F00C4 -g MyResourceGroup --storage-account mystorageaccount
Restore a file share within a valid retention days if share soft delete is enabled to a new name.
az storage share-rm restore -n deletedshare --deleted-version 01D64EB9886F00C4 --restored-name newname -g MyResourceGroup --storage-account mystorageaccount
Required Parameters
Identify the version of the deleted share that will be restored.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The file share name. Identify the name of the deleted share that will be restored.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
A new file share name to be restored. If not specified, deleted share name will be used.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm show
Show the properties for a specified Azure file share or share snapshot.
az storage share-rm show [--expand]
[--ids]
[--name]
[--resource-group]
[--snapshot]
[--storage-account]
[--subscription]
Examples
Show the properties for an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account name) in resource group 'MyResourceGroup'.
az storage share-rm show -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Show the properties for an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account id).
az storage share-rm show --storage-account mystorageaccount --name myfileshare
Show the properties of an Azure file share by resource id.
az storage share-rm show --ids file-share-id
Show the properties of an Azure file share snapshot
az storage share-rm show --ids file-share-id --snapshot "2021-03-25T05:29:56.0000000Z"
Optional Parameters
Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','. Default value is None.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The file share name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The DateTime value that specifies the share snapshot to retrieve.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm snapshot
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Create a snapshot of an existing share under the specified account.
az storage share-rm snapshot [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
[--enabled-protocols {NFS, SMB}]
[--ids]
[--metadata]
[--name]
[--quota]
[--resource-group]
[--root-squash {AllSquash, NoRootSquash, RootSquash}]
[--storage-account]
[--subscription]
Examples
Create a snapshot of an existing share under the specified account.
az storage share-rm snapshot -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Optional Parameters
Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
Immutable property for file shares protocol. NFS protocol will be only available for premium file shares (file shares in the FileStorage account type).
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Metadata in space-separated key=value pairs that is associated with the share. This overwrites any existing metadata.
The file share name.
The maximum size of the share in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Reduction of the access rights for the remote superuser.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm stats
Get the usage bytes of the data stored on the share.
az storage share-rm stats [--ids]
[--name]
[--resource-group]
[--storage-account]
[--subscription]
Examples
Get the usage bytes of the data stored on the share.
az storage share-rm stats -g MyResourceGroup --storage-account mystorageaccount --name myfileshare
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The file share name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az storage share-rm update
Update the properties for an Azure file share.
az storage share-rm update [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
[--add]
[--force-string]
[--ids]
[--metadata]
[--name]
[--quota]
[--remove]
[--resource-group]
[--root-squash {AllSquash, NoRootSquash, RootSquash}]
[--set]
[--storage-account]
[--subscription]
Examples
Update the properties for an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account name) in resource group 'MyResourceGroup'.
az storage share-rm update -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 3 --metadata key1=value1 key2=value2
Update the properties for an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account id).
az storage share-rm update --storage-account mystorageaccount --name myfileshare --quota 3 --metadata key1=value1 key2=value2
Update the properties for an Azure file shares by resource id.
az storage share-rm update --ids file-share-id --quota 3 --metadata key1=value1 key2=value2
Optional Parameters
Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Metadata in space-separated key=value pairs that is associated with the share. This overwrites any existing metadata.
The file share name.
The maximum size of the share in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Reduction of the access rights for the remote superuser.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
The name or ID of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.