|
| 1 | +--- |
| 2 | +title: Access SMB volumes from Windows clients joined to Azure Active Directory |
| 3 | +description: Explains how to connect Azure NetApp Files volumes from on-premises environment using Azure Active Directory (AD). |
| 4 | +ms.service: azure-netapp-files |
| 5 | +ms.workload: storage |
| 6 | +ms.topic: how-to |
| 7 | +author: b-ahibbard |
| 8 | +ms.author: anfdocs |
| 9 | +ms.date: 07/17/2023 |
| 10 | +--- |
| 11 | +# Access SMB volumes from Windows clients joined to Azure Active Directory |
| 12 | + |
| 13 | +You can use Azure Active Directory (Azure AD) with the Hybrid Authentication Management module to authenticate credentials in your hybrid cloud. This solution enables Azure AD to become the trusted source for both cloud and on-premises authentication, circumventing the need for clients connecting to Azure NetApp Files to join the on-premises AD domain. |
| 14 | + |
| 15 | +<!-- diagram --> |
| 16 | + |
| 17 | +## Steps |
| 18 | + |
| 19 | +Before you can connect your on-premises environment to Azure AD, you must have: |
| 20 | + |
| 21 | +* [created an Azure NetApp Files volume](azure-netapp-files-create-volumes-smb.md). |
| 22 | + * added the CIFS SPN to the computer account created as part of the Azure NetApp Files volume in on-premises Active Directory. |
| 23 | + |
| 24 | +### Create an Azure AD application |
| 25 | + |
| 26 | +1. In the Azure portal, navigate to Azure AD then **App Registrations**. |
| 27 | +1. Select **+ New**. |
| 28 | +1. Assign a **Name**. Under select the **Supported account type**, choose **Accounts in this organizational directory only (Single tenant)**. Select **Register**. |
| 29 | + |
| 30 | + :::image type="content" source="../media/azure-netapp-files/register-application-active-directory.png" alt-text="Screenshot to register application." lightbox="../media/azure-netapp-files/register-application-active-directory.png"::: |
| 31 | + |
| 32 | +1. Configure the permissions for the application. From your **App Registrations**, select **API Permissions** then **Add a Permission**. |
| 33 | +1. Select **Microsoft Graph** then **Delegated Permissions**. Under **Select Permissions**, search for "openid" and select it. Then search for "profile" and add it. |
| 34 | + |
| 35 | + :::image type="content" source="../media/azure-netapp-files/api-permissions.png" alt-text="Screenshot to register API permissions." lightbox="../media/azure-netapp-files/api-permissions.png"::: |
| 36 | + |
| 37 | +1. Grant **Admin Consent** on your application. |
| 38 | + |
| 39 | +### Install Azure AD Connect in your on-premises environment |
| 40 | + |
| 41 | +1. Sign on to your on-premises Active Directory account. |
| 42 | +1. Create a local user and assign it administrator privileges. This user serves to connect to Azure AD. |
| 43 | +1. Install [Azure AD Connect](https://www.microsoft.com/download/details.aspx?id=47594) using the Azure AD global administrator account. For more information, see [Get started with Azure AD Connect by using express settings](../active-directory/hybrid/connect/how-to-connect-install-express.md). |
| 44 | + |
| 45 | + 1. Configure the service connection point (SCP) and synchronize. |
| 46 | + 1. In the Azure portal under **Azure Active Directory**, navigate to **Users**. Verify the domain local user is synchronized with the Azure AD users. |
| 47 | + >[!NOTE] |
| 48 | + >When you add a new local user after the initial configuration, you must run the `Start-ADSyncSyncCycle` command in the Administrator PowerShell to synchronize the new user to Azure AD. |
| 49 | + |
| 50 | +:::image type="content" source="../media/azure-netapp-files/multi-value-string-editor.png" alt-text="Screenshot of multi-value string editor window." lightbox="../media/azure-netapp-files/multi-value-string-editor.png"::: |
| 51 | + |
| 52 | +### Sync CIFS password from on-premises AD to Azure AD application |
| 53 | + |
| 54 | +1. In your on-premises environment, sign into Active Directory. |
| 55 | +2. Open PowerShell. |
| 56 | +1. Install the [Hybrid Authentication Management module](/azure/azure-sql/managed-instance/winauth-azuread-setup-incoming-trust-based-flow) for synchronizing passwords. |
| 57 | + |
| 58 | + ```powershell |
| 59 | + Install-Module -Name AzureADHybridAuthenticationManagement -AllowClobber -Force |
| 60 | + ``` |
| 61 | +
|
| 62 | +1. Provide values for: |
| 63 | + * `$servicePrincipalName`: The SPN details from mounting the Azure NetApp Files volume. Use the CIFS/FQDN format. For example: `CIFS/NETBIOS-1234.CONTOSO.COM` |
| 64 | + * `$targetApplicationID`: Application ID of the Azure AD application. |
| 65 | + * `$domainCred`: use `Get-Credential` |
| 66 | + * `$cloudCred`: use `Get-Credential` |
| 67 | +
|
| 68 | + ```powershell |
| 69 | + $servicePrincipalName = CIFS/NETBIOS-1234.CONTOSO.COM |
| 70 | + $targetApplicationID = 0c94fc72-c3e9-4e4e-9126-2c74b45e66fe |
| 71 | + $domainCred = Get-Credential |
| 72 | + $cloudCred = Get-Credential |
| 73 | + ``` |
| 74 | + >[!NOTE] |
| 75 | + >The `Get-Credential` command will initiate a pop-up Window where you can enter credentials. |
| 76 | +
|
| 77 | +1. Import the CIFS details to Azure AD: |
| 78 | +
|
| 79 | + ```powershell |
| 80 | + Import-AzureADKerberosOnPremServicePrincipal -Domain $domain -DomainCredential $domainCred -CloudCredential $cloudCred -ServicePrincipalName $servicePrincipalName -ApplicationId $targetApplicationId |
| 81 | + ``` |
| 82 | +
|
| 83 | +### Create an Azure AD joined machine and mount to an Azure NetApp Files volume |
| 84 | +
|
| 85 | +1. Create two VMs in Azure NetApp Files: one Azure AD-registered and the other Azure AD-joined. |
| 86 | + 1. The **Azure AD-registered VM** facilitates access to the Azure AD-joined machine. Sign into the AD-registered VM using the credentials created during machine creation in the Azure portal: |
| 87 | + In **Settings** under **Work and school account**, select **Connect to Azure > Use global Azure AD cloud account username and password**. |
| 88 | +
|
| 89 | + 1. The **Azure AD-joined VM**: |
| 90 | + Sign into the Azure AD-registered VM then launch a remote desktop to the Azure AD-joined VM. |
| 91 | + In **Settings** under **Work and school account**, select **Join this device to Azure Active Directory** then **Use hybrid user credentials**. Reboot the VM. |
| 92 | +
|
| 93 | +1. Sign into the Azure AD-joined VM again using your hybrid credentials (for example: AZUREAD\[email protected]). |
| 94 | +
|
| 95 | + >[!NOTE] |
| 96 | + > If you run into issues signing on, select more choices, then provide credentials. |
| 97 | +
|
| 98 | +1. Configure the VM: |
| 99 | + 1. Navigate to **Group Policy > Computer Configuration > Administrative Templates > System > Kerberos**. Enable **Allow retrieving the cloud Kerberos ticket during the logon**. |
| 100 | +
|
| 101 | + 1. Select **Define host name-to-Kerberos realm mappings**. Provide a name and value using the fully qualified domain name from the mount instructions (for example, name: KERBEROS.MICROSOFTONLINE.COM and value: NETBIOS-1234.contoso.com). |
| 102 | +
|
| 103 | + :::image type="content" source="../media/azure-netapp-files/define-host-name-to-kerberos.png" alt-text="Screenshot to define how-name-to-Kerberos real mappings." lightbox="../media/azure-netapp-files/define-host-name-to-kerberos.png"::: |
| 104 | + |
| 105 | +1. Manually add DNS mapping in the hosts. |
| 106 | + Open `C:\Windows\System32\drivers\etc\hosts` as an administrator. Add an entry based on the mount point and LIF, for example `10.5.1.4 NETBIOS-1234.contoso.com`. Use the hybrid credentials retrieved during the machine creation. Cloud user credentials don't have the correct permission to modify the `/etc/hosts/` file. |
| 107 | +1. Mount using the mount info provided from Azure NetApp Files. Open a command prompt and run: `net use * \\ NETBIOS-1234.contoso.com\volume1` |
| 108 | +1. Confirm the mounted volume is using Kerberos and not NTLM authentication. In the command prompt, issue the `klist` command and observe the output in the cloud TGT (`krbtgt`) and CIFS server ticket information. |
| 109 | +
|
| 110 | + :::image type="content" source="../media/azure-netapp-files/klist-output.png" alt-text="Screenshot of CLI output." lightbox="../media/azure-netapp-files/klist-output.png"::: |
| 111 | +
|
| 112 | +## Further information |
| 113 | +
|
| 114 | +* [Understand guidelines for Active Directory Domain Services](understand-guidelines-active-directory-domain-service-site.md) |
| 115 | +* [Create and manage Active Directory connections](create-active-directory-connections.md) |
| 116 | +* [Introduction to Azure AD Connect V2.0](../active-directory/hybrid/connect/whatis-azure-ad-connect-v2.md) |
0 commit comments