CmdID / az / az storage / az storage share-rm
az storage share-rm delete
Delete the specified Azure file share or share snapshot. Azure CLI reference
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.
6 examples 4 options Its page in the Azure CLI reference
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 myfileshareIdentify-gName of resource group.--storage-accountThe name of the storage account within the specified resource group.--nameThe name of the file share within the specified storage account.Delete an Azure file share 'myfileshare' under the storage account 'mystorageaccount' (account id).
az storage share-rm delete --storage-account mystorageaccount --name myfileshareIdentify--storage-accountThe name of the storage account within the specified resource group.--nameThe name of the file share within the specified storage account.Delete an Azure file share by resource id.
az storage share-rm delete --ids file-share-idIdentify--idsOne or more resource IDs (space-delimited).Delete an Azure file share snapshot.
az storage share-rm delete --ids file-share-id --snapshot "2021-03-25T05:29:56.0000000Z"Identify--idsOne or more resource IDs (space-delimited).--snapshotOptional, used to delete a snapshot.The DateTime value that specifies the share snapshot to retrieve.Delete an Azure file share and all its snapshots.
az storage share-rm delete --include snapshots -g MyResourceGroup --storage-account mystorageaccount --name myfileshareIdentify--includeOptional.-gName of resource group.--storage-accountThe name of the storage account within the specified resource group.--nameThe name of the file share within the specified storage account.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 myfileshareIdentify--includeOptional.-gName of resource group.--storage-accountThe name of the storage account within the specified resource group.--nameThe name of the file share within the specified storage account.Options
--includeOptional.--share-name, --name, -nThe name of the file share within the specified storage account.--snapshotOptional, used to delete a snapshot.The DateTime value that specifies the share snapshot to retrieve.--storage-account, --account-nameThe name of the storage account within the specified resource group.