You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/storage-files-aad-permissions-and-mounting.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
author: khdownie
6
6
ms.service: storage
7
7
ms.topic: include
8
-
ms.date: 10/31/2022
8
+
ms.date: 11/01/2022
9
9
ms.author: kendownie
10
10
ms.custom: include file, devx-track-azurecli, devx-track-azurepowershell
11
11
---
@@ -72,8 +72,6 @@ After you assign share-level permissions with RBAC, you must assign Windows ACLs
72
72
73
73
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.
74
74
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
-
77
75
The following sets of permissions are supported on the root directory of a file share:
78
76
79
77
- BUILTIN\Administrators:(OI)(CI)(F)
@@ -84,28 +82,22 @@ The following sets of permissions are supported on the root directory of a file
84
82
- NT AUTHORITY\SYSTEM:(F)
85
83
- CREATOR OWNER:(OI)(CI)(IO)(F)
86
84
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.
88
88
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.
90
90
91
91
> [!NOTE]
92
92
> 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.
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
-
}
102
94
```
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
+
```
105
97
106
98
### Configure Windows ACLs with Windows File Explorer
107
99
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.
109
101
110
102
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.
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).
130
122
131
-
## Mount a file share from a domain-joined VM
123
+
## Mount the file share from a domain-joined VM
132
124
133
125
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.
0 commit comments