Skip to content

Commit b8065c5

Browse files
Merge pull request #259612 from khdownie/kendownie112723
Adding CNAME instructions
2 parents f2c5211 + 29813ae commit b8065c5

File tree

3 files changed

+40
-13
lines changed

3 files changed

+40
-13
lines changed

articles/storage/files/storage-files-faq.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Frequently asked questions (FAQ) for Azure Files
33
description: Get answers to Azure Files frequently asked questions. You can mount Azure file shares concurrently on cloud or on-premises Windows, Linux, or macOS deployments.
44
author: khdownie
55
ms.service: azure-file-storage
6-
ms.date: 10/30/2023
6+
ms.date: 11/28/2023
77
ms.author: kendownie
88
ms.topic: conceptual
99
---
@@ -114,11 +114,7 @@ ms.topic: conceptual
114114
* <a id="ad-file-mount-cname"></a>
115115
**Can I use the canonical name (CNAME) to mount an Azure file share while using identity-based authentication?**
116116

117-
No, this scenario isn't currently supported in single-forest AD environments. This is because when receiving the mount request, Azure Files depends on the Kerberos ticket's server name field to determine what storage account the request is intended for. If `storageaccount.file.core.windows.net` isn't present in the Kerberos ticket as the server name, then the service can't decide which storage account the request is for and is therefore unable to set up an SMB session for the user.
118-
119-
As an alternative to CNAME, you can use DFS Namespaces with SMB Azure file shares. To learn more, see [How to use DFS Namespaces with Azure Files](files-manage-namespaces.md).
120-
121-
As a workaround for mounting the file share, see the instructions in [Mount the file share from a non-domain-joined VM or a VM joined to a different AD domain](storage-files-identity-ad-ds-mount-file-share.md#mount-the-file-share-from-a-non-domain-joined-vm-or-a-vm-joined-to-a-different-ad-domain).
117+
Yes, this scenario is now supported in both [single-forest](storage-files-identity-ad-ds-mount-file-share.md#mount-file-shares-using-custom-domain-names) and [multi-forest](storage-files-identity-multiple-forests.md) environments for SMB Azure file shares. However, Azure Files only supports configuring CNAMEs using the storage account name as a domain prefix. If you don't want to use the storage account name as a prefix, consider using [DFS Namespaces](files-manage-namespaces.md) instead.
122118

123119
* <a id="ad-vm-subscription"></a>
124120
**Can I access Azure file shares with Microsoft Entra credentials from a VM under a different subscription?**

articles/storage/files/storage-files-identity-ad-ds-mount-file-share.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to mount an Azure file share to your on-premises Active D
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 11/21/2023
7+
ms.date: 11/28/2023
88
ms.author: kendownie
99
ms.custom: engagement-fy23
1010
recommendations: false
@@ -32,14 +32,11 @@ Before you can mount the Azure file share, make sure you've gone through the fol
3232
- If you're mounting the file share from a client that has previously connected to the file share using your storage account key, make sure that you've disconnected the share, removed the persistent credentials of the storage account key, and are currently using AD DS credentials for authentication. For instructions on how to remove cached credentials with storage account key and delete existing SMB connections before initializing a new connection with AD DS or Microsoft Entra credentials, follow the two-step process on the [FAQ page](./storage-files-faq.md#identity-based-authentication).
3333
- Your client must have unimpeded network connectivity to your AD DS. If your machine or VM is outside of the network managed by your AD DS, you'll need to enable VPN to reach AD DS for authentication.
3434

35-
> [!NOTE]
36-
> Using the canonical name (CNAME) to mount an Azure file share isn't currently supported while using identity-based authentication in single-forest AD environments.
37-
3835
## Mount the file share from a domain-joined VM
3936

4037
Run the PowerShell script below or [use the Azure portal](storage-files-quick-create-use-windows.md#map-the-azure-file-share-to-a-windows-drive) to persistently mount the Azure file share and map it 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](storage-how-to-use-files-windows.md).
4138

42-
Mount Azure file shares using `file.core.windows.net`, even if you set up a private endpoint for your share.
39+
Unless you're using [custom domain names](#mount-file-shares-using-custom-domain-names), you should mount Azure file shares using the suffix `file.core.windows.net`, even if you set up a private endpoint for your share.
4340

4441
```powershell
4542
$connectTestResult = Test-NetConnection -ComputerName <storage-account-name>.file.core.windows.net -Port 445
@@ -71,6 +68,40 @@ For example:
7168
net use Z: \\<YourStorageAccountName>.file.core.windows.net\<FileShareName> /user:<username@domainFQDN>
7269
```
7370

71+
## Mount file shares using custom domain names
72+
73+
If you don't want to mount Azure file shares using the suffix `file.core.windows.net`, you can modify the suffix of the storage account name associated with the Azure file share, and then add a canonical name (CNAME) record to route the new suffix to the endpoint of the storage account. The following instructions are for single-forest environments only. To learn how to configure environments that have two or more forests, see [Use Azure Files with multiple Active Directory forests](storage-files-identity-multiple-forests.md).
74+
75+
> [!NOTE]
76+
> Azure Files only supports configuring CNAMES using the storage account name as a domain prefix. If you don't want to use the storage account name as a prefix, consider using [DFS namepaces](files-manage-namespaces.md).
77+
78+
In this example, we have the Active Directory domain *onpremad1.com*, and we have a storage account called *mystorageaccount* which contains SMB Azure file shares. First, we need to modify the SPN suffix of the storage account to map *mystorageaccount.onpremad1.com* to *mystorageaccount.file.core.windows.net*.
79+
80+
This will allow clients to mount the share with `net use \\mystorageaccount.onpremad1.com` because clients in *onpremad1* will know to search *onpremad1.com* to find the proper resource for that storage account.
81+
82+
To use this method, complete the following steps:
83+
84+
1. Make sure you've set up identity-based authentication and synced your AD user account(s) to Microsoft Entra ID.
85+
86+
2. Modify the SPN of the storage account using the setspn tool. You can find `<DomainDnsRoot>` by running the following Active Directory PowerShell command: `(Get-AdDomain).DnsRoot`
87+
88+
```
89+
setspn -s cifs/<storage-account-name>.<DomainDnsRoot> <storage-account-name>
90+
```
91+
92+
3. Add a CNAME entry using Active Directory DNS Manager and follow the steps below for each storage account in the domain that the storage account is joined to. If you're using a private endpoint, add the CNAME entry to map to the private endpoint name.
93+
94+
1. Open Active Directory DNS Manager.
95+
1. Go to your domain (for example, **onpremad1.com**).
96+
1. Go to "Forward Lookup Zones".
97+
1. Select the node named after your domain (for example, **onpremad1.com**) and right-click **New Alias (CNAME)**.
98+
1. For the alias name, enter your storage account name.
99+
1. For the fully qualified domain name (FQDN), enter **`<storage-account-name>`.`<domain-name>`**, such as **mystorageaccount.onpremad1.com**. The hostname part of the FQDN must match the storage account name. Otherwise you'll get an access denied error during the SMB session setup.
100+
1. For the target host FQDN, enter **`<storage-account-name>`.file.core.windows.net**
101+
1. Select **OK**.
102+
103+
You should now be able to mount the file share using either *storageaccount.domainname.com* or *storageaccount.file.core.windows.net*. You can also mount the file share using the storage account key.
104+
74105
## Next steps
75106

76107
If the identity you created in AD DS to represent the storage account is in a domain or OU that enforces password rotation, you might need to [update the password of your storage account identity in AD DS](storage-files-identity-ad-ds-update-password.md).

articles/storage/files/storage-files-identity-auth-domain-services-enable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to enable identity-based authentication over Server Messa
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 11/22/2023
7+
ms.date: 11/28/2023
88
ms.author: kendownie
99
ms.custom: engagement-fy23, devx-track-azurecli, devx-track-azurepowershell
1010
recommendations: false
@@ -310,7 +310,7 @@ Sign in to the domain-joined VM using the Microsoft Entra identity to which you
310310

311311
Run the PowerShell script below or [use the Azure portal](storage-files-quick-create-use-windows.md#map-the-azure-file-share-to-a-windows-drive) to persistently mount the Azure file share and map it to drive Z: on Windows. If Z: is already in use, replace it with an available drive letter. Because you've been authenticated, you won't need to provide the storage account key. 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 `<storage-account-name>` and `<file-share-name>` with your own values. For more information, see [Use an Azure file share with Windows](storage-how-to-use-files-windows.md).
312312

313-
Always mount Azure file shares using `file.core.windows.net`, even if you set up a private endpoint for your share.
313+
Unless you're using [custom domain names](storage-files-identity-ad-ds-mount-file-share.md#mount-file-shares-using-custom-domain-names), you should mount Azure file shares using the suffix `file.core.windows.net`, even if you set up a private endpoint for your share.
314314

315315
```powershell
316316
$connectTestResult = Test-NetConnection -ComputerName <storage-account-name>.file.core.windows.net -Port 445

0 commit comments

Comments
 (0)