Skip to content

Commit d8ca6cf

Browse files
authored
Minor update for Preview
1 parent 0cb4825 commit d8ca6cf

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

articles/storage/files/storage-files-active-directory-domain-services-enable.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ ms.author: rogarana
1717
>
1818
> AD identities used for Azure file share authentication must be synced to Azure AD. Password hash synchronization is optional.
1919
>
20-
> AD authentication does not support authentication against Computer accounts created in Azure AD DS.
20+
> AD authentication does not support authentication against Computer accounts created in AD.
2121
>
22-
> AD authentication can only be supported against one AD forest where the storage account is registered to. You can only access Azure file shares with the AD credentials from a single AD forest by default. If you need to access your Azure file share from a different forest, make sure that you have the proper forest trust configured.
22+
> AD authentication can only be supported against one AD forest where the storage account is registered to. You can only access Azure file shares with the AD credentials from a single AD forest by default. If you need to access your Azure file share from a different forest, make sure that you have the proper forest trust configured, see [FAQ](https://docs.microsoft.com/en-us/azure/storage/files/storage-files-faq#security-authentication-and-access-control) for details.
2323
>
2424
> AD authentication for SMB access and ACL persistence is supported for Azure file shares managed by Azure File Sync.
2525
@@ -37,9 +37,9 @@ Before you enable AD authentication for Azure file shares, make sure you have co
3737

3838
To setup an AD domain environment, refer to [Active Directory Domain Services Overview](https://docs.microsoft.com/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview). If you have not synced your AD to your Azure AD, follow the guidance in [What is hybrid identity with Azure Active Directory?](../../active-directory/hybrid/whatis-hybrid-identity.md) in order to determine your preferred authentication method and Azure AD Connect setup option.
3939

40-
- Domain-join an on-premises machine or an Azure VM using AD DS or AD.
40+
- Domain-join an on-premises machine or an Azure VM to AD (also refered as AD DS).
4141

42-
To access a file share by using AD credentials from a machine or VM, your device must be domain-joined to AD DS. For information about how to domain-join to AD, refer to [Join a Computer to a Domain](https://docs.microsoft.com/windows-server/identity/ad-fs/deployment/join-a-computer-to-a-domain).
42+
To access a file share by using AD credentials from a machine or VM, your device must be domain-joined to AD. For information about how to domain-join to AD, refer to [Join a Computer to a Domain](https://docs.microsoft.com/windows-server/identity/ad-fs/deployment/join-a-computer-to-a-domain).
4343

4444
- Select or create an Azure storage account in [a supported region](#regional-availability).
4545

@@ -96,13 +96,15 @@ The `join-AzStorageAccountForAuth` cmdlet will perform the equivalent of an offl
9696

9797
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.
9898

99-
### Script prerequisites
100-
99+
### 1. Check prerequisites
101100
- [Download and unzip the AzFilesHybrid module](https://github.com/Azure-Samples/azure-files-samples/releases)
102101
- 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.
103102
- 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.
104103
- Make sure your storage account is in a [supported region](#regional-availability).
105104

105+
### 2. Execute AD enablement script
106+
Remember to replace the placeholder values with your own in the parameters below before exeucting it in Powershell.
107+
106108
```PowerShell
107109
#Change the execution policy to unblock importing AzFilesHybrid.psm1 module
108110
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Currentuser
@@ -117,22 +119,24 @@ Import-Module -name AzFilesHybrid
117119
Connect-AzAccount
118120
119121
#Select the target subscription for the current session
120-
Select-AzureSubscription -SubscriptionId "<yourSubscriptionIdHere>"
122+
Select-AzureSubscription -SubscriptionId "<your-subscription-id-here>"
121123
122124
#Register the target storage account with your active directory environment under the target OU
123125
join-AzStorageAccountForAuth -ResourceGroupName "<resource-group-name-here>" -Name "<storage-account-name-here>" -DomainAccountType "<ServiceLogonAccount|ComputerAccount>" -OrganizationUnitName "<ou-name-here>"
124126
```
125127

126-
127128
The following is a description of the actions performed when the `join-AzStorageAccountForAuth` command is used. You may perform these steps manually, if you prefer not to use the command:
128129

129-
### Checking environment
130+
> [!NOTE]
131+
> If you have already executed the join-AzStorageAccountForAuth script above successfuly, go to the next section "3. Confirm that the feature is enabled". You do not need to perform the operations below again.
132+
133+
#### a. Checking environment
130134

131-
First, it checks your environment. Specifically it checks if the [Active Directory PowerShell](https://docs.microsoft.com/powershell/module/addsadministration/?view=win10-ps) is installed and if the shell is being executed with administrator privileges. Then it checks to see if the [Az.Storage 1.11.1-preview module](https://www.powershellgallery.com/packages/Az.Storage/1.11.1-preview) is installed, and installs it if it isn't. If those checks pass, then it will check your AD to see if there is 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 [service logon account](https://docs.microsoft.com/windows/win32/ad/about-service-logon-accounts) that has already been created with SPN/UPN as "cifs/your-storage-account-name-here.file.core.windows.net" and create one if it doesn't exist.
135+
First, it checks your environment. Specifically it checks if the [Active Directory PowerShell](https://docs.microsoft.com/powershell/module/addsadministration/?view=win10-ps) is installed and if the shell is being executed with administrator privileges. Then it checks to see if the [Az.Storage 1.11.1-preview module](https://www.powershellgallery.com/packages/Az.Storage/1.11.1-preview) is installed, and installs it if it isn't. If those checks pass, then it will check your AD to see if there is 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 [service logon account](https://docs.microsoft.com/windows/win32/ad/about-service-logon-accounts) that has already been created with SPN/UPN as "cifs/your-storage-account-name-here.file.core.windows.net". If the account doesn't exist, it will create one as described in section b below.
132136

133-
### Creating an identity representing the storage account in your AD manually
137+
#### b. Creating an identity representing the storage account in your AD manually
134138

135-
To create this account manually, create a new kerberos key for your storage account using `New-AzStorageAccountKey -Keynam "yourKeyName"`. Then, use that kerberos key as the password for your account. This key is only used during setup and cannot be used for any control or data plane operations against the storage account.
139+
To create this account manually, create a new kerberos key for your storage account using `New-AzStorageAccountKey -KeyName kerb1`. Then, use that kerberos key as the password for your account. This key is only used during setup and cannot be used for any control or data plane operations against the storage account.
136140

137141
Once you have that key, create either a service or computer account under your OU. Use the following specification:
138142
SPN: "cifs/your-storage-account-name-here.file.core.windows.net"
@@ -142,9 +146,9 @@ If your OU enforces password expiration, you must update the password before the
142146

143147
Keep the SID of the newly created account, you'll need it for the next step.
144148

145-
### Enable the feature on your storage account
149+
##### c. Enable the feature on your storage account
146150

147-
The script would then enable the feature on your storage account. To do this manually, provide some configuration details for the domain properties in the following command, then run it. The storage account SID required in the following command is the SID of the identity you created in AD.
151+
The script would then enable the feature on your storage account. To do this manually, provide some configuration details for the domain properties in the following command, then run it. The storage account SID required in the following command is the SID of the identity you created in AD (section b above).
148152

149153
```PowerShell
150154
#Set the feature flag on the target storage account and provide the required AD domain information
@@ -153,9 +157,9 @@ Set-AzStorageAccount -ResourceGroupName "<your-resource-group-name-here>" -Name
153157
```
154158

155159

156-
### Check if the feature is enabled
160+
### 3. Confirm that the feature is enabled
157161

158-
If you want to check whether the feature is enabled on your storage account, you can use the following script:
162+
You can check to confirm whether the feature is enabled on your storage account, you can use the following script:
159163

160164
```PowerShell
161165
#Get the target storage account
@@ -172,11 +176,11 @@ You've now successfully enabled the feature on your storage account. Even though
172176

173177
[!INCLUDE [storage-files-aad-permissions-and-mounting](../../../includes/storage-files-aad-permissions-and-mounting.md)]
174178

175-
You have now successfully enabled Azure 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.
179+
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.
176180

177181
## Update AD account password
178182

179-
If you registered the AD 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.
183+
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.
180184

181185
To trigger password rotation, you can run the `Update-AzStorageAccountADObjectPassword` command from the [AzFilesHybrid module](#script-prerequisites). The cmdlet performs actions similar to storage account key rotation. It gets the second Kerberos key of the storage account and uses it to update the password of the registered account in AD. Then it regenerates the target Kerberos key of the storage account and updates the password of the registered account in AD. You must run this cmdlet in an AD domain joined environment.
182186

@@ -190,4 +194,4 @@ Update-AzStorageAccountADObjectPassword -RotateToKerbKey kerb2 -ResourceGroupNam
190194
For more information about Azure Files and how to use AD over SMB, see these resources:
191195

192196
- [ Overview of Azure Files identity-based authentication support for SMB access](storage-files-active-directory-overview.md)
193-
- [FAQ](storage-files-faq.md)
197+
- [FAQ](storage-files-faq.md)

0 commit comments

Comments
 (0)