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: articles/storage/files/storage-files-identity-auth-active-directory-enable.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,15 +67,17 @@ Azure Files AD authentication (preview) is available in [all regions in Public C
67
67
68
68
Before you enable AD Authentication over SMB for Azure file shares, we recommend that you walk through the [prerequisites](#prerequisites) and make sure you've completed all the steps. The prerequisites validate that your AD, Azure AD, and Azure Storage environments are properly configured.
69
69
70
-
Next, grant access to Azure Files resources with AD credentials:
70
+
Next, follow the steps below to setup Azure Files for AD Authentication:
71
71
72
-
- Enable Azure Files AD authentication on your storage account.
72
+
1. Enable Azure Files AD authentication on your storage account.
73
73
74
-
- Assign access permissions for a share to the Azure AD identity (a user, group, or service principal) that is in sync with the target AD identity.
74
+
2. Assign access permissions for a share to the Azure AD identity (a user, group, or service principal) that is in sync with the target AD identity.
75
75
76
-
- Configure ACLs over SMB for directories and files.
76
+
3. Configure ACLs over SMB for directories and files.
77
77
78
-
- Mount an Azure file share from an AD domain joined VM.
78
+
4. Mount an Azure file share from an AD domain joined VM.
79
+
80
+
5. Rotate AD account password (Optional)
79
81
80
82
The following diagram illustrates the end-to-end workflow for enabling Azure AD authentication over SMB for Azure file shares.
81
83
@@ -84,25 +86,28 @@ The following diagram illustrates the end-to-end workflow for enabling Azure AD
84
86
> [!NOTE]
85
87
> AD authentication over SMB for Azure file shares is only supported on machines or VMs running on OS versions newer than Windows 7 or Windows Server 2008 R2.
86
88
87
-
## Enable AD authentication for your account
89
+
## 1. Enable AD authentication for your account
88
90
89
91
To enable AD authentication over SMB for Azure file shares, you need to first register your storage account with AD and then set the required domain properties on the storage account. When the feature is enabled on the storage account, it applies to all new and existing file shares in the account. Use `join-AzStorageAccountForAuth` to enable the feature. You can find the detailed description of the end-to-end workflow in the section below.
90
92
91
93
> [!IMPORTANT]
92
94
> The `Join-AzStorageAccountForAuth` cmdlet will make modifications to your AD environment. Read the following explanation to better understand what it is doing to ensure you have the proper permissions to execute the command and that the applied changes align with the compliance and security policies.
93
95
94
-
The `Join-AzStorageAccountForAuth` cmdlet will perform the equivalent of an offline domain join on behalf of the indicated storage account. It will create an account in your AD domain, either a [computer account](https://docs.microsoft.com/windows/security/identity-protection/access-control/active-directory-accounts#manage-default-local-accounts-in-active-directory) or a [service logon account](https://docs.microsoft.com/windows/win32/ad/about-service-logon-accounts). The created AD account represents the storage account in the AD domain. If the AD account is created under an AD Organizational Unit (OU) that enforces password expiration, you must update the password before the maximum password age. Failing to update AD account password will result in authentication failures when accessing Azure file shares. To learn how to update the password, see [Update AD account password](#update-ad-account-password).
96
+
The `Join-AzStorageAccountForAuth` cmdlet will perform the equivalent of an offline domain join on behalf of the indicated storage account. It will create an account in your AD domain, either a [computer account](https://docs.microsoft.com/windows/security/identity-protection/access-control/active-directory-accounts#manage-default-local-accounts-in-active-directory)(default) or a [service logon account](https://docs.microsoft.com/windows/win32/ad/about-service-logon-accounts). The created AD account represents the storage account in the AD domain. If the AD account is created under an AD Organizational Unit (OU) that enforces password expiration, you must update the password before the maximum password age. Failing to update AD account password will result in authentication failures when accessing Azure file shares. To learn how to update the password, see [Update AD account password](#update-ad-account-password).
95
97
96
98
You can use the following script to perform the registration and enable the feature or, alternatively, you can manually perform the operations that the script would. Those operations are described in the section following the script. You do not need to do both.
97
99
98
-
### 1. Check prerequisites
100
+
### 1.1 Check prerequisites
99
101
-[Download and unzip the AzFilesHybrid module](https://github.com/Azure-Samples/azure-files-samples/releases)
100
102
- Install and execute the module in a device that is domain joined to AD with AD credentials that have permissions to create a service logon account or a computer account in the target AD.
101
103
- Run the script using an AD credential that is synced to your Azure AD. The AD credential must have either the storage account owner or the contributor RBAC role permissions.
102
104
- Make sure your storage account is in a [supported region](#regional-availability).
103
105
104
-
### 2. Domain join your storage account
106
+
### 1.2 Domain join your storage account
105
107
Remember to replace the placeholder values with your own in the parameters below before executing it in PowerShell.
108
+
> [!IMPORTANT]
109
+
> We recommend you to provide an AD Organizational Unit (OU) that does NOT enforce password expiration. If you use an OU with password expiration configured, you must update the password before the maximum password age. Failing to update AD account password will result in authentication failures when accessing Azure file shares. To learn how to update the password, see [Update AD account password](#update-ad-account-password).
110
+
106
111
107
112
```PowerShell
108
113
#Change the execution policy to unblock importing AzFilesHybrid.psm1 module
# Register the target storage account with your active directory environment under the target OU (for example: specify the OU with Name as "UserAccounts" or DistinguishedName as "OU=UserAccounts,DC=CONTOSO,DC=COM").
124
-
# You can use to this PowerShell cmdlet: Get-ADOrganizationalUnit to find the Name and DistinguishedName of your target OU. If you are using the OU Name, specify it with -OrganizationalUnitName as shown below. If you are using the OU DistinguishedName, you can set it with -OrganizationalUnitDistinguishedName.
129
+
# You can use to this PowerShell cmdlet: Get-ADOrganizationalUnit to find the Name and DistinguishedName of your target OU. If you are using the OU Name, specify it with -OrganizationalUnitName as shown below. If you are using the OU DistinguishedName, you can set it with -OrganizationalUnitDistinguishedName. You can choose to provide one of the two names to specify the target OU.
125
130
# You can choose to create the identity that represents the storage account as either a Service Logon Account or Computer Account, depends on the AD permission you have and preference.
126
131
Join-AzStorageAccountForAuth `
127
132
-ResourceGroupName "<resource-group-name-here>" `
128
133
-Name "<storage-account-name-here>" `
129
134
-DomainAccountType "ComputerAccount" `
130
-
-OrganizationalUnitName "<ou-name-here>"
135
+
-OrganizationalUnitName "<ou-name-here>" or -OrganizationalUnitDistinguishedName "<ou-distinguishedname-here>"
131
136
```
132
137
133
138
The following description summarizes all actions performed when the `Join-AzStorageAccountForAuth` cmdlet gets executed. You may perform these steps manually, if you prefer not to use the command:
134
139
135
140
> [!NOTE]
136
-
> If you have already executed the `Join-AzStorageAccountForAuth` script above successfully, go to the next section "3. Confirm that the feature is enabled". You do not need to perform the operations below again.
141
+
> If you have already executed the `Join-AzStorageAccountForAuth` script above successfully, go to the next section "1.3 Confirm that the feature is enabled". You do not need to perform the operations below again.
137
142
138
143
#### a. Checking environment
139
144
@@ -170,7 +175,7 @@ Set-AzStorageAccount `
170
175
```
171
176
172
177
173
-
### 3. Confirm that the feature is enabled
178
+
### 1.3 Confirm that the feature is enabled
174
179
175
180
You can check to confirm whether the feature is enabled on your storage account, you can use the following script:
176
181
@@ -193,7 +198,7 @@ You've now successfully enabled the feature on your storage account. Even though
193
198
194
199
You have now successfully enabled AD authentication over SMB and assigned a custom role that provides access to an Azure file share with an AD identity. To grant additional users access to your file share, follow the instructions in the [Assign access permissions](#assign-access-permissions-to-an-identity) to use an identity and [Configure NTFS permissions over SMB](#configure-ntfs-permissions-over-smb) sections.
195
200
196
-
## Update AD account password
201
+
## 5. Update AD account password
197
202
198
203
If you registered the AD identity/account representing your storage account under an OU that enforces password expiration time, you must rotate the password before the maximum password age. Failing to update the password of the AD account will result in authentication failures to access Azure file shares.
0 commit comments