Create an Azure File Share
This guide walks you through the process of creating a new Azure File Share using the Azure portal and Azure CLI.
Note: Azure Files offers fully managed cloud file shares that are accessible via the industry-standard Server Message Block (SMB) protocol.
Prerequisites
Before you begin, ensure you have:
- An Azure Subscription. If you don't have one, create a free account.
- An Azure Storage Account. If you don't have one, you can create it through the Azure portal.
Method 1: Using the Azure Portal
The Azure portal provides a user-friendly interface for creating and managing Azure resources.
1.
Navigate to your Storage Account in the Azure portal.
2.
In the Storage Account menu, under Data storage, select File shares.
3.
Click the + File share button at the top of the File shares blade.
4.
In the Create file share panel, enter the following details:
- Name: A unique name for your file share (e.g.,
myshare). Naming rules apply. - Tier: Choose between Transaction optimized, Hot, or Cool.
- Quota: The maximum size of the file share in GiB.
5.
Click Create.
Method 2: Using Azure CLI
The Azure Command-Line Interface (CLI) is a powerful tool for automating Azure tasks.
First, ensure you have the Azure CLI installed and are logged in:
az login
Next, create a file share using the az storage share create command.
1.
Open your terminal or command prompt and run the following command, replacing placeholders with your actual values:
az storage share create \
--name \
--account-name \
--account-key \
--quota \
--output table
Example:
az storage share create \
--name myshare \
--account-name mystorageaccount \
--account-key "YOUR_ACCOUNT_KEY" \
--quota 1024 \
--output table
Note: You can find your storage account name and key in the Access keys section of your storage account in the Azure portal.
What's Next?
Once your file share is created, you can:
- Mount the file share to your client machines.
- Upload and download files using various tools and SDKs.
- Configure access control for your file share.
Key Considerations
- Naming Conventions: File share names must be 3-63 characters long, and can only contain lowercase letters, numbers, and hyphens. They must start and end with a letter or number.
- Tiers: Choose the tier that best suits your workload's performance and cost requirements.
- Quota: The quota defines the maximum capacity of the file share.