Skip to content

Commit d8f5cbb

Browse files
Merge pull request #216731 from khdownie/kendownie110122
updating mounting instrux
2 parents fcc87cc + 8da0832 commit d8f5cbb

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

includes/storage-files-aad-permissions-and-mounting.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
author: khdownie
66
ms.service: storage
77
ms.topic: include
8-
ms.date: 10/31/2022
8+
ms.date: 11/01/2022
99
ms.author: kendownie
1010
ms.custom: include file, devx-track-azurecli, devx-track-azurepowershell
1111
---
@@ -72,8 +72,6 @@ After you assign share-level permissions with RBAC, you must assign Windows ACLs
7272

7373
Azure Files supports the full set of basic and advanced permissions. You can view and configure Windows ACLs on directories and files in an Azure file share by mounting the share and then using Windows File Explorer or running the Windows [icacls](/windows-server/administration/windows-commands/icacls) or [Set-ACL](/powershell/module/microsoft.powershell.security/set-acl) command.
7474

75-
To configure superuser permissions, you must mount the share by using your storage account key from your domain-joined VM. Follow the instructions in the next section to mount an Azure file share using the storage account key and to configure Windows ACLs accordingly.
76-
7775
The following sets of permissions are supported on the root directory of a file share:
7876

7977
- BUILTIN\Administrators:(OI)(CI)(F)
@@ -84,28 +82,22 @@ The following sets of permissions are supported on the root directory of a file
8482
- NT AUTHORITY\SYSTEM:(F)
8583
- CREATOR OWNER:(OI)(CI)(IO)(F)
8684

87-
## Connect to the Azure file share
85+
### Mount the Azure file share
86+
87+
Before you configure Windows ACLs, you must first mount the file share to your domain-joined VM by using your storage account key. To do this, log into the domain-joined VM as an Azure AD user, open a Windows command prompt, and run the following command. Remember to replace `<YourStorageAccountName>`, `<FileShareName>`, and `<YourStorageAccountKey>` with your own values. If Z: is already in use, replace it with an available drive letter. 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` PowerShell cmdlet.
8888

89-
Run the script below from a normal (not elevated) PowerShell terminal to connect to the Azure file share using the storage account key and map the share to drive Z: on Windows. If Z: is already in use, replace it with an available drive letter. The script will check to see if this storage account is accessible via TCP port 445, which is the port SMB uses. Remember to replace the placeholder values with your own values. For more information, see [Use an Azure file share with Windows](../articles/storage/files/storage-how-to-use-files-windows.md).
89+
It's important that you use the `net use` Windows command to mount the share at this stage and not PowerShell. If you use PowerShell to mount the share, then the share won't be visible to Windows File Explorer or cmd.exe, and you won't be able to configure Windows ACLs.
9090

9191
> [!NOTE]
9292
> You might see the **Full Control** ACL applied to a role already. This typically already offers the ability to assign permissions. However, because there are access checks at two levels (the share level and the file/directory level), this is restricted. Only users who have the **SMB Elevated Contributor** role and create a new file or directory can assign permissions on those new files or directories without using the storage account key. All other file/directory permission assignment requires connecting to the share using the storage account key first.
9393
94-
```powershell
95-
$connectTestResult = Test-NetConnection -ComputerName <storage-account-name>.file.core.windows.net -Port 445
96-
if ($connectTestResult.TcpTestSucceeded) {
97-
cmd.exe /C "cmdkey /add:`"<storage-account-name>.file.core.windows.net`" /user:`"localhost\<storage-account-name>`" /pass:`"<storage-account-key>`""
98-
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\<storage-account-name>.file.core.windows.net\<file-share-name>"
99-
} else {
100-
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
101-
}
10294
```
103-
104-
If you experience issues connecting to Azure Files on Windows, refer to [this troubleshooting tool](https://azure.microsoft.com/blog/new-troubleshooting-diagnostics-for-azure-files-mounting-errors-on-windows/).
95+
net use Z: \\<YourStorageAccountName>.file.core.windows.net\<FileShareName> /user:localhost\<YourStorageAccountName> <YourStorageAccountKey>
96+
```
10597

10698
### Configure Windows ACLs with Windows File Explorer
10799

108-
After you've connected to your Azure file share, you must configure the Windows ACLs. You can do this using either Windows File Explorer or icacls.
100+
After you've mounted your Azure file share, you must configure the Windows ACLs. You can do this using either Windows File Explorer or icacls.
109101

110102
Follow these steps to use Windows File Explorer to grant full permission to all directories and files under the file share, including the root directory.
111103

@@ -128,7 +120,7 @@ icacls <mounted-drive-letter>: /grant <user-email>:(f)
128120

129121
For more information on how to use icacls to set Windows ACLs and the different types of supported permissions, see [the command-line reference for icacls](/windows-server/administration/windows-commands/icacls).
130122

131-
## Mount a file share from a domain-joined VM
123+
## Mount the file share from a domain-joined VM
132124

133125
The following process verifies that your file share and access permissions were set up correctly and that you can access an Azure File share from a domain-joined VM. Be aware that the share-level Azure role assignment can take some time to take effect.
134126

0 commit comments

Comments
 (0)