Skip to content

Commit 1b9ca04

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into updateDiagramsHA
2 parents 2d60d98 + 0a000d6 commit 1b9ca04

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

articles/storage/files/storage-how-to-use-files-linux.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ author: khdownie
55
ms.service: azure-file-storage
66
ms.custom: linux-related-content, devx-track-azurecli
77
ms.topic: how-to
8-
ms.date: 01/10/2023
8+
ms.date: 05/13/2024
99
ms.author: kendownie
1010
---
1111

12-
# Mount SMB Azure file share on Linux
12+
# Mount SMB Azure file shares on Linux clients
1313

1414
> [!CAUTION]
1515
> This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and plan accordingly. For more information, see the [CentOS End Of Life guidance](~/articles/virtual-machines/workloads/centos/centos-end-of-life.md).
16-
[Azure Files](storage-files-introduction.md) is Microsoft's easy to use cloud file system. Azure file shares can be mounted in Linux distributions using the [SMB kernel client](https://wiki.samba.org/index.php/LinuxCIFS).
16+
17+
Azure file shares can be mounted in Linux distributions using the [SMB kernel client](https://wiki.samba.org/index.php/LinuxCIFS).
1718

1819
The recommended way to mount an Azure file share on Linux is using SMB 3.1.1. By default, Azure Files requires encryption in transit, which is supported by SMB 3.0+. Azure Files also supports SMB 2.1, which doesn't support encryption in transit, but you can't mount Azure file shares with SMB 2.1 from another Azure region or on-premises for security reasons. Unless your application specifically requires SMB 2.1, use SMB 3.1.1.
1920

@@ -31,21 +32,23 @@ If your Linux distribution isn't listed in the above table, you can check the Li
3132
uname -r
3233
```
3334

34-
> [!Note]
35+
> [!NOTE]
3536
> SMB 2.1 support was added to Linux kernel version 3.7. If you're using a version of the Linux kernel after 3.7, it should support SMB 2.1.
3637
3738
## Applies to
39+
3840
| File share type | SMB | NFS |
3941
|-|:-:|:-:|
4042
| Standard file shares (GPv2), LRS/ZRS | ![Yes](../media/icons/yes-icon.png) | ![No](../media/icons/no-icon.png) |
4143
| Standard file shares (GPv2), GRS/GZRS | ![Yes](../media/icons/yes-icon.png) | ![No](../media/icons/no-icon.png) |
4244
| Premium file shares (FileStorage), LRS/ZRS | ![Yes](../media/icons/yes-icon.png) | ![No](../media/icons/no-icon.png) |
4345

4446
## Prerequisites
47+
4548
<a id="smb-client-reqs"></a>
4649

4750
* <a id="install-cifs-utils"></a>**Ensure the cifs-utils package is installed.**
48-
The cifs-utils package can be installed using the package manager on the Linux distribution of your choice.
51+
Install the cifs-utils package using the package manager on the Linux distribution of your choice.
4952

5053

5154
# [Ubuntu](#tab/Ubuntu)
@@ -84,7 +87,7 @@ On other distributions, use the appropriate package manager or [compile from sou
8487

8588
* **The most recent version of the Azure Command Line Interface (CLI).** For more information on how to install the Azure CLI, see [Install the Azure CLI](/cli/azure/install-azure-cli) and select your operating system. If you prefer to use the Azure PowerShell module in PowerShell 6+, you may; however, the instructions in this article are for the Azure CLI.
8689

87-
* **Ensure port 445 is open**: SMB communicates over TCP port 445 - make sure your firewall or ISP isn't blocking TCP port 445 from the client machine. Replace `<your-resource-group>` and `<your-storage-account>` and then run the following script:
90+
* **Ensure port 445 is open**: SMB communicates over TCP port 445 - make sure your firewall or ISP isn't blocking TCP port 445 from the client machine. Replace `<your-resource-group>` and `<your-storage-account>` and then run the following script:
8891

8992
```bash
9093
RESOURCE_GROUP_NAME="<your-resource-group>"
@@ -110,6 +113,7 @@ On other distributions, use the appropriate package manager or [compile from sou
110113
If you're unable to open up port 445 on your corporate network or are blocked from doing so by an ISP, you may use a VPN connection or ExpressRoute to work around port 445. For more information, see [Networking considerations for direct Azure file share access](storage-files-networking-overview.md).
111114
112115
## Mount the Azure file share on-demand with mount
116+
113117
When you mount a file share on a Linux OS, your remote file share is represented as a folder in your local file system. You can mount file shares to anywhere on your system. The following example mounts under the `/media` path. You can change this to your preferred path you want by modifying the `$MNT_ROOT` variable.
114118
115119
Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with the appropriate information for your environment:
@@ -128,7 +132,7 @@ sudo mkdir -p $MNT_PATH
128132
Next, mount the file share using the `mount` command. In the following example, the `$SMB_PATH` command is populated using the fully qualified domain name for the storage account's file endpoint and `$STORAGE_ACCOUNT_KEY` is populated with the storage account key.
129133

130134
# [SMB 3.1.1](#tab/smb311)
131-
> [!Note]
135+
> [!NOTE]
132136
> Starting in Linux kernel version 5.0, SMB 3.1.1 is the default negotiated protocol. If you're using a version of the Linux kernel older than 5.0, specify `vers=3.1.1` in the mount options list.
133137
134138
```azurecli
@@ -188,14 +192,15 @@ You can use `uid`/`gid` or `dir_mode` and `file_mode` in the mount options for t
188192
You can also mount the same Azure file share to multiple mount points if desired. When you're done using the Azure file share, use `sudo umount $mntPath` to unmount the share.
189193
190194
## Automatically mount file shares
195+
191196
When you mount a file share on a Linux OS, your remote file share is represented as a folder in your local file system. You can mount file shares to anywhere on your system. The following example mounts under the `/media` path. You can change this to your preferred path you want by modifying the `$MNT_ROOT` variable.
192197
193198
```bash
194199
MNT_ROOT="/media"
195200
sudo mkdir -p $MNT_ROOT
196201
```
197202
198-
To mount an Azure file share on Linux, use the storage account name as the username of the file share, and the storage account key as the password. Because the storage account credentials may change over time, you should store the credentials for the storage account separately from the mount configuration.
203+
To mount an Azure file share on Linux, use the storage account name as the username of the file share, and the storage account key as the password. Because the storage account credentials might change over time, you should store the credentials for the storage account separately from the mount configuration.
199204
200205
The following example shows how to create a file to store the credentials. Remember to replace `<resource-group-name>` and `<storage-account-name>` with the appropriate information for your environment.
201206
@@ -232,6 +237,7 @@ sudo chmod 600 $SMB_CREDENTIAL_FILE
232237
To automatically mount a file share, you have a choice between using a static mount via the `/etc/fstab` utility or using a dynamic mount via the `autofs` utility.
233238
234239
### Static mount with /etc/fstab
240+
235241
Using the earlier environment, create a folder for your storage account/file share under your mount folder. Replace `<file-share-name>` with the appropriate name of your Azure file share.
236242
237243
```bash
@@ -241,9 +247,9 @@ MNT_PATH="$MNT_ROOT/$STORAGE_ACCOUNT_NAME/$FILE_SHARE_NAME"
241247
sudo mkdir -p $MNT_PATH
242248
```
243249
244-
Finally, create a record in the `/etc/fstab` file for your Azure file share. In the command below, the default 0755 Linux file and folder permissions are used, which means read, write, and execute for the owner (based on the file/directory Linux owner), read and execute for users in owner group, and read and execute for others on the system. You may wish to set alternate `uid` and `gid` or `dir_mode` and `file_mode` permissions on mount as desired. For more information on how to set permissions, see [UNIX numeric notation](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) on Wikipedia.
250+
Finally, create a record in the `/etc/fstab` file for your Azure file share. In the command below, the default 0755 Linux file and folder permissions are used, which means read, write, and execute for the owner (based on the file/directory Linux owner), read and execute for users in owner group, and read and execute for others on the system. You might wish to set alternate `uid` and `gid` or `dir_mode` and `file_mode` permissions on mount as desired. For more information on how to set permissions, see [UNIX numeric notation](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation).
245251
246-
> [!Tip]
252+
> [!TIP]
247253
> If you want Docker containers running .NET Core applications to be able to write to the Azure file share, include **nobrl** in the SMB mount options to avoid sending byte range lock requests to the server.
248254
249255
```bash
@@ -262,10 +268,11 @@ fi
262268
sudo mount -a
263269
```
264270
265-
> [!Note]
271+
> [!NOTE]
266272
> Starting in Linux kernel version 5.0, SMB 3.1.1 is the default negotiated protocol. You can specify alternate protocol versions using the `vers` mount option (protocol versions are `3.1.1`, `3.0`, and `2.1`).
267273
268274
### Dynamically mount with autofs
275+
269276
To dynamically mount a file share with the `autofs` utility, install it using the package manager on the Linux distribution of your choice.
270277
271278
# [Ubuntu](#tab/Ubuntu)
@@ -345,6 +352,7 @@ After you've created the file share snapshot, follow these instructions to mount
345352
If the mount fails, see [Troubleshoot Azure Files connectivity and access issues (SMB)](/troubleshoot/azure/azure-storage/files-troubleshoot-smb-connectivity?toc=/azure/storage/files/toc.json).
346353
347354
## Next steps
355+
348356
See these links for more information about Azure Files:
349357
350358
- [Planning for an Azure Files deployment](storage-files-planning.md)

articles/storage/files/storage-how-to-use-files-portal.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
title: Quickstart for creating and using Azure file shares
3-
description: Learn how to create and use Azure file shares with the Azure portal, Azure CLI, or Azure PowerShell. Create a storage account, create an SMB Azure file share, and use your Azure file share.
3+
description: Learn how to create and use SMB Azure file shares with the Azure portal, Azure CLI, or Azure PowerShell. Create a storage account, then create and use an Azure file share.
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: quickstart
7-
ms.date: 10/10/2023
7+
ms.date: 05/13/2024
88
ms.author: kendownie
99
ms.custom: engagement-fy23, mode-ui, devx-track-azurecli, devx-track-azurepowershell
1010
ms.devlang: azurecli
1111
#Customer intent: As an IT admin new to Azure Files, I want to try out Azure Files so I can determine whether I want to subscribe to the service.
1212
---
1313

14-
# Quickstart: Create and use an Azure file share
15-
[Azure Files](storage-files-introduction.md) is Microsoft's easy-to-use cloud file system. You can mount Azure file shares in Windows, Linux, and macOS operating systems. This article shows you how to create an SMB Azure file share using either the Azure portal, Azure CLI, or Azure PowerShell.
14+
# Quickstart: Create and use an SMB Azure file share
15+
16+
[Azure Files](storage-files-introduction.md) is Microsoft's easy-to-use cloud file system. You can mount SMB Azure file shares in Windows, Linux, and macOS operating systems. This article shows you how to create an Azure file share using either the Azure portal, Azure CLI, or Azure PowerShell.
1617

1718
## Applies to
1819

@@ -58,6 +59,7 @@ If you'd like to install and use PowerShell locally, you'll need the Azure Power
5859

5960

6061
### PowerShell - Create a resource group
62+
6163
A resource group is a logical container into which Azure resources are deployed and managed. If you don't already have an Azure resource group, create a new one with the [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) cmdlet. You need a resource group to create a storage account.
6264

6365
The following example creates a resource group named *myResourceGroup* in the West US 2 region:
@@ -92,6 +94,7 @@ $storageAcct = New-AzStorageAccount `
9294
# [Azure CLI](#tab/azure-cli)
9395

9496
### CLI - Create a resource group
97+
9598
A resource group is a logical container in which Azure resources are deployed and managed. If you don't already have an Azure resource group, you can use the [az group create](/cli/azure/group) command to create one. You need a resource group to create a storage account.
9699

97100
The following example creates a resource group named *myResourceGroup* in the *West US 2* location:
@@ -107,6 +110,7 @@ az group create \
107110
```
108111

109112
### CLI - Create a storage account
113+
110114
A storage account is a shared pool of storage in which you can deploy Azure file shares.
111115

112116
The following example creates a storage account using the [az storage account create](/cli/azure/storage/account) command. Storage account names must be unique, so use `$RANDOM` to append a random number to the name to make it unique.
@@ -130,7 +134,6 @@ az storage account create \
130134

131135
## Create an Azure file share
132136

133-
134137
# [Portal](#tab/azure-portal)
135138

136139
To create an Azure file share:
@@ -220,9 +223,9 @@ az storage directory create \
220223
---
221224

222225

223-
#### Upload a file
224-
# [Portal](#tab/azure-portal)
226+
#### Upload a file
225227

228+
# [Portal](#tab/azure-portal)
226229

227230
First, you need to create or select a file to upload. Do this by whatever means you see fit. When you've decided on the file you'd like to upload, follow these steps:
228231

@@ -298,11 +301,11 @@ az storage file list \
298301
---
299302

300303
#### Download a file
304+
301305
# [Portal](#tab/azure-portal)
302306

303307
You can download a copy of the file you uploaded by right-clicking on the file and selecting **Download**. The exact experience will depend on the operating system and browser you're using.
304308

305-
306309
# [PowerShell](#tab/azure-powershell)
307310

308311
You can use the [Get-AzStorageFileContent](/powershell/module/az.storage/Get-AzStorageFilecontent) cmdlet to download a copy of the file you uploaded to the scratch drive of your Cloud Shell.
@@ -346,6 +349,7 @@ az storage file download \
346349
---
347350

348351
## Clean up resources
352+
349353
# [Portal](#tab/azure-portal)
350354

351355
[!INCLUDE [storage-files-clean-up-portal](../../../includes/storage-files-clean-up-portal.md)]
@@ -366,10 +370,9 @@ When you're done, you can use the [`az group delete`](/cli/azure/group) command
366370
az group delete --name $resourceGroupName
367371
```
368372

369-
370373
---
371374

372-
## Next steps
375+
## Next step
373376

374377
> [!div class="nextstepaction"]
375378
> [What is Azure Files?](storage-files-introduction.md)

0 commit comments

Comments
 (0)