Skip to content

Commit a9780a8

Browse files
committed
Updating create a file share with delete instrux
1 parent aac4f23 commit a9780a8

File tree

2 files changed

+55
-16
lines changed

2 files changed

+55
-16
lines changed
49.4 KB
Loading

articles/storage/files/storage-how-to-create-file-share.md

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Create an Azure file share
2+
title: Create an SMB Azure file share
33
titleSuffix: Azure Files
4-
description: How to create an Azure file share by using the Azure portal, PowerShell, or the Azure CLI.
4+
description: How to create an SMB Azure file share by using the Azure portal, PowerShell, or Azure CLI.
55
author: khdownie
66
ms.service: storage
77
ms.topic: how-to
8-
ms.date: 07/27/2021
8+
ms.date: 10/19/2022
99
ms.author: kendownie
1010
ms.subservice: files
1111
ms.custom: devx-track-azurecli, references_regions, devx-track-azurepowershell
1212
---
1313

14-
# Create an Azure file share
14+
# Create an SMB Azure file share
1515
To create an Azure file share, you need to answer three questions about how you will use it:
1616

1717
- **What are the performance requirements for your Azure file share?**
@@ -35,9 +35,9 @@ For more information on these three choices, see [Planning for an Azure Files de
3535
| Premium file shares (FileStorage), LRS/ZRS | ![Yes](../media/icons/yes-icon.png) | ![No](../media/icons/no-icon.png) |
3636

3737
## Prerequisites
38-
- This article assumes that you have already created an Azure subscription. If you don't already have a subscription, then create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
38+
- This article assumes that you've already created an Azure subscription. If you don't already have a subscription, then create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3939
- If you intend to use Azure PowerShell, [install the latest version](/powershell/azure/install-az-ps).
40-
- If you intend to use the Azure CLI, [install the latest version](/cli/azure/install-azure-cli).
40+
- If you intend to use Azure CLI, [install the latest version](/cli/azure/install-azure-cli).
4141

4242
## Create a storage account
4343
Azure file shares are deployed into *storage accounts*, which are top-level objects that represent a shared pool of storage. This pool of storage can be used to deploy multiple file shares.
@@ -80,14 +80,14 @@ The advanced section contains several important settings for Azure file shares:
8080

8181
:::image type="content" source="media/storage-how-to-create-file-share/files-create-smb-share-secure-transfer.png" alt-text="A screenshot of secure transfer enabled in the advanced settings for the storage account.":::
8282

83-
- **Large file shares**: This field enables the storage account for file shares spanning up to 100 TiB. Enabling this feature will limit your storage account to only locally redundant and zone redundant storage options. Once a GPv2 storage account has been enabled for large file shares, you cannot disable the large file share capability. FileStorage storage accounts (storage accounts for premium file shares) do not have this option, as all premium file shares can scale up to 100 TiB.
83+
- **Large file shares**: This field enables the storage account for file shares spanning up to 100 TiB. Enabling this feature will limit your storage account to only locally redundant and zone redundant storage options. Once a GPv2 storage account has been enabled for large file shares, you cannot disable the large file share capability. FileStorage storage accounts (storage accounts for premium file shares) don't have this option, as all premium file shares can scale up to 100 TiB.
8484

8585
:::image type="content" source="media/storage-how-to-create-file-share/files-create-smb-share-large-file-shares.png" alt-text="A screenshot of the large file share setting in the storage account's advanced blade.":::
8686

87-
The other settings that are available in the advanced tab (hierarchical namespace for Azure Data Lake storage gen 2, default blob tier, NFSv3 for blob storage, etc.) do not apply to Azure Files.
87+
The other settings that are available in the advanced tab (hierarchical namespace for Azure Data Lake storage gen 2, default blob tier, NFSv3 for blob storage, etc.) don't apply to Azure Files.
8888

8989
> [!Important]
90-
> Selecting the blob access tier does not affect the tier of the file share.
90+
> Selecting the blob access tier doesn't affect the tier of the file share.
9191
9292
#### Tags
9393
Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups. These are optional and can be applied after storage account creation.
@@ -98,7 +98,7 @@ The final step to create the storage account is to select the **Create** button
9898
# [PowerShell](#tab/azure-powershell)
9999
To create a storage account using PowerShell, we will use the `New-AzStorageAccount` cmdlet. This cmdlet has many options; only the required options are shown. To learn more about advanced options, see the [`New-AzStorageAccount` cmdlet documentation](/powershell/module/az.storage/new-azstorageaccount).
100100

101-
To simplify the creation of the storage account and subsequent file share, we will store several parameters in variables. You may replace the variable contents with whatever values you wish, however note that the storage account name must be globally unique.
101+
To simplify the creation of the storage account and subsequent file share, we will store several parameters in variables. You may replace the variable contents with whatever values you wish; however, note that the storage account name must be globally unique.
102102

103103
```powershell
104104
$resourceGroupName = "myResourceGroup"
@@ -130,7 +130,7 @@ $storAcct = New-AzStorageAccount `
130130
```
131131

132132
# [Azure CLI](#tab/azure-cli)
133-
To create a storage account using the Azure CLI, we will use the az storage account create command. This command has many options; only the required options are shown. To learn more about the advanced options, see the [`az storage account create` command documentation](/cli/azure/storage/account).
133+
To create a storage account using Azure CLI, we will use the az storage account create command. This command has many options; only the required options are shown. To learn more about the advanced options, see the [`az storage account create` command documentation](/cli/azure/storage/account).
134134

135135
To simplify the creation of the storage account and subsequent file share, we will store several parameters in variables. You may replace the variable contents with whatever values you wish, however note that the storage account name must be globally unique.
136136

@@ -165,8 +165,8 @@ az storage account create \
165165

166166
---
167167

168-
### Enable large files shares on an existing account
169-
Before you create an Azure file share on an existing storage account, you may want to enable it for large file shares (up to 100 TiB) if you haven't already. Standard storage accounts using either LRS or ZRS can be upgraded to support large file shares without causing downtime for existing file shares on the storage account. If you have a GRS, GZRS, RA-GRS, or RA-GZRS account, you will need to convert it to an LRS account before proceeding.
168+
### Enable large file shares on an existing account
169+
Before you create an Azure file share on an existing storage account, you might want to enable large file shares (up to 100 TiB) on the storage account if you haven't already. Standard storage accounts using either LRS or ZRS can be upgraded to support large file shares without causing downtime for existing file shares on the storage account. If you have a GRS, GZRS, RA-GRS, or RA-GZRS account, you'll need to convert it to an LRS account before proceeding.
170170

171171
# [Portal](#tab/azure-portal)
172172
1. Open the [Azure portal](https://portal.azure.com), and navigate to the storage account where you want to enable large file shares.
@@ -348,7 +348,46 @@ az storage share-rm update \
348348

349349
---
350350

351+
## Delete a file share
352+
To delete an Azure file share, you can use the Azure portal, Azure PowerShell, or Azure CLI. Shares can be recovered within the [soft delete](storage-files-prevent-file-share-deletion.md) retention period.
353+
354+
# [Portal](#tab/azure-portal)
355+
1. Open the [Azure portal](https://portal.azure.com), and navigate to the storage account that contains the file share you want to delete.
356+
1. Open the storage account and select **File shares**.
357+
1. Select the file share you want to delete.
358+
1. Select **Delete share**.
359+
1. Check the box confirming that you agree to the deletion of the file share and all its content.
360+
1. Select **Delete**.
361+
362+
:::image type="content" source="media/storage-how-to-create-file-share/delete-file-share.png" alt-text="Screen shot of the Azure portal procedure for deleting a file share." border="true" lightbox="media/storage-how-to-create-file-share/delete-file-share.png":::
363+
364+
# [PowerShell](#tab/azure-powershell)
365+
1. Log in to your Azure account and specify your tenant ID.
366+
367+
```azurepowershell
368+
Login-AzAccount -TenantId <YourTenantID>
369+
```
370+
371+
1. Run the following script. Replace `<YourStorageAccountName>`, `<StorageAccountKey>`, and `<FileShareName>` with your information. You can find your storage account key in the Azure portal by navigating to the storage account and selecting **Security + networking** > **Access keys**, or you can use the `Get-AzStorageAccountKey` cmdlet.
372+
373+
```azurepowershell
374+
$context = New-AzStorageContext -StorageAccountName <YourStorageAccountName> -StorageAccountKey <YourStorageAccountKey>
375+
Remove-AzStorageShare -Context $context -Name "<FileShareName>"
376+
```
377+
378+
# [Azure CLI](#tab/azure-cli)
379+
You can delete an Azure file share with the [`az storage share delete`](/cli/azure/storage/share#az-storage-share-delete) command. Replace `<yourFileShareName>` and `<yourStorageAccountName>` with your information.
380+
381+
```azurecli
382+
383+
az storage share delete \
384+
--name <yourFileShareName> \
385+
--account-name <yourStorageAccountName>
386+
```
387+
388+
---
389+
351390
## Next steps
352-
- [Plan for a deployment of Azure Files](storage-files-planning.md) or [Plan for a deployment of Azure File Sync](../file-sync/file-sync-planning.md).
353-
- [Networking overview](storage-files-networking-overview.md).
354-
- Connect and mount a file share on [Windows](storage-how-to-use-files-windows.md), [macOS](storage-how-to-use-files-mac.md), and [Linux](storage-how-to-use-files-linux.md).
391+
- [Planning for an Azure Files deployment](storage-files-planning.md) or [Planning for an Azure File Sync deployment](../file-sync/file-sync-planning.md).
392+
- [Azure Files networking overview](storage-files-networking-overview.md).
393+
- Mount an SMB file share on [Windows](storage-how-to-use-files-windows.md), [macOS](storage-how-to-use-files-mac.md), or [Linux](storage-how-to-use-files-linux.md).

0 commit comments

Comments
 (0)