|
| 1 | +--- |
| 2 | +title: Create FSLogix profile container Azure Files Active Directory Domain Services - Azure |
| 3 | +description: This article describes how to create an FSLogix profile container with Azure Files and Azure Active Directory Domain Services. |
| 4 | +services: virtual-desktop |
| 5 | +author: Heidilohr |
| 6 | + |
| 7 | +ms.service: virtual-desktop |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 04/10/2020 |
| 10 | +ms.author: helohr |
| 11 | +manager: lizross |
| 12 | +--- |
| 13 | + |
| 14 | +# Create an FSLogix profile container with Azure Files |
| 15 | + |
| 16 | +This article will show you how to create an FSLogix profile container with Azure Files and Azure Active Directory Domain Services (AD DS). |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +This article assumes you've already set up an Azure AD DS instance. If you don't have one yet, follow the instructions in [Create a basic managed domain](../active-directory-domain-services/tutorial-create-instance.md) first, then return here. |
| 21 | + |
| 22 | +## Add Azure AD DS admins |
| 23 | + |
| 24 | +To add additional admins, you create a new user and grant them permissions. |
| 25 | + |
| 26 | +To add an admin: |
| 27 | + |
| 28 | +1. Select **Azure Active Directory** from the sidebar, then select **All users**, and then select **New user**. |
| 29 | + |
| 30 | +2. Enter the user details into the fields. |
| 31 | + |
| 32 | +3. In the Azure Active Directory pane on the left side of the screen, select **Groups**. |
| 33 | + |
| 34 | +4. Select the **AAD DC Administrators** group. |
| 35 | + |
| 36 | +5. In the left pane, select **Members**, then select **Add members** in the main pane. This will show a list of all users available in Azure AD. Select the name of the user profile you just created. |
| 37 | + |
| 38 | +## Set up an Azure Storage account |
| 39 | + |
| 40 | +Now it's time to enable Azure AD DS authentication over Server Message Block (SMB). |
| 41 | + |
| 42 | +To enable authentication: |
| 43 | + |
| 44 | +1. If you haven't already, set up and deploy a general-purpose v2 Azure Storage account by following the instructions in [Create an Azure Storage account](../storage/common/storage-account-create.md). |
| 45 | + |
| 46 | +2. Once you've finished setting up your account, select **Go to resource**. |
| 47 | + |
| 48 | +3. Select **Configuration** from the pane on the left side of the screen, then enable **Azure Active Directory authentication for Azure Files** in the main pane. When you're done, select **Save**. |
| 49 | + |
| 50 | +4. Select **Overview** in the pane on the left side of the screen, then select **Files** in the main pane. |
| 51 | + |
| 52 | +5. Select **File share** and enter the **Name** and **Quota** into the fields that appear on the right side of the screen. |
| 53 | + |
| 54 | +## Assign access permissions to an identity |
| 55 | + |
| 56 | +Other users will need access permissions to access your file share. To do this, you'll need to assign each user a role with the appropriate access permissions. |
| 57 | + |
| 58 | +To assign users access permissions: |
| 59 | + |
| 60 | +1. From the Azure portal, open the file share you created in [Set up an Azure Storage account](#set-up-an-azure-storage-account). |
| 61 | + |
| 62 | +2. Select **Access Control (IAM)**. |
| 63 | + |
| 64 | +3. Select **Add a role assignment**. |
| 65 | + |
| 66 | +4. In the **Add role assignment** tab, select the appropriate built-in role from the role list. You'll need to at least select **Storage File Data SMB Share Contributor** for the account to get proper permissions. |
| 67 | + |
| 68 | +5. For **Assign access to**, select **Azure Active Directory user, group, or service principal**. |
| 69 | + |
| 70 | +6. Select a name or email address for the target Azure Active Directory identity. |
| 71 | + |
| 72 | +7. Select **Save**. |
| 73 | + |
| 74 | +## Get the Storage Account access key |
| 75 | + |
| 76 | +Next, you'll need to get the access key for your Storage Account. |
| 77 | + |
| 78 | +To get the Storage Account access key: |
| 79 | + |
| 80 | +1. From the Azure portal sidebar, select **Storage accounts**. |
| 81 | + |
| 82 | +2. From the list of storage accounts, select the account for which you enabled Azure AD DS and created the custom roles in steps above. |
| 83 | + |
| 84 | +3. Under **Settings**, select **Access keys** and copy the key from **key1**. |
| 85 | + |
| 86 | +4. Go to the **Virtual Machines** tab and locate any VM that will become part of your host pool. |
| 87 | + |
| 88 | +5. Select the name of the virtual machine (VM) under **Virtual Machines (adVM)** and select **Connect** |
| 89 | + |
| 90 | + This will download an RDP file that will let you sign in to the VM with its own credentials. |
| 91 | + |
| 92 | +  |
| 93 | + |
| 94 | +6. When you've signed in to the VM, run a command prompt as an administrator. |
| 95 | + |
| 96 | +7. Run the following command: |
| 97 | + |
| 98 | + ```cmd |
| 99 | + net use <desired-drive-letter>: \\<storage-account-name>.file.core.windows.net\<share-name> <storage-account-key> /user:Azure\<storage-account-name> |
| 100 | + ``` |
| 101 | +
|
| 102 | + - Replace `<desired-drive-letter>` with a drive letter of your choice (for example, `y:`). |
| 103 | + - Replace all instances of `<storage-account-name>` with the name of the storage account you specified earlier. |
| 104 | + - Replace `<share-name>` with the name of the share you created earlier. |
| 105 | + - Replace `<storage-account-key>` with the storage account key from Azure. |
| 106 | +
|
| 107 | + For example: |
| 108 | + |
| 109 | + ```cmd |
| 110 | + net use y: \\fsprofile.file.core.windows.net\share HDZQRoFP2BBmoYQ=(truncated)= /user:Azure\fsprofile) |
| 111 | + ``` |
| 112 | +
|
| 113 | +8. Run the following command to grant the user full access to the Azure Files share. |
| 114 | +
|
| 115 | + ```cmd |
| 116 | + icacls <mounted-drive-letter>: /grant <user-email>:(f) |
| 117 | + ``` |
| 118 | +
|
| 119 | + - Replace `<mounted-drive-letter>` with the letter of the drive you want the user to use. |
| 120 | + - Replace `<user-email>` with the UPN of the user who will use this profile to access the session host VMs. |
| 121 | +
|
| 122 | + For example: |
| 123 | + |
| 124 | + ```cmd |
| 125 | + icacls y: /grant [email protected]:(f) |
| 126 | + ``` |
| 127 | +
|
| 128 | +## Create a profile container |
| 129 | +
|
| 130 | +Now that your profiles are ready to go, let's create a FSLogix profile container. |
| 131 | +
|
| 132 | +To configure a FSLogix profile container: |
| 133 | +
|
| 134 | +1. Sign in to the session host VM you configured at the beginning of this article, then [download and install the FSLogix agent](/fslogix/install-ht/). |
| 135 | +
|
| 136 | +2. Unzip the FSLogix agent file you downloaded and go to **x64** > **Releases**, then open **FSLogixAppsSetup.exe**. |
| 137 | +
|
| 138 | +3. Once the installer launches, select **I agree to the license terms and conditions.** If applicable, provide a new key. |
| 139 | +
|
| 140 | +4. Select **Install**. |
| 141 | +
|
| 142 | +5. Open **Drive C**, then go to **Program Files** > **FSLogix** > **Apps** to make sure the FSLogix agent was properly installed. |
| 143 | +
|
| 144 | + >[!NOTE] |
| 145 | + > If there are multiple VMs in the host pool, you'll need to repeat steps 1 through 5 for each VM. |
| 146 | +
|
| 147 | +6. Run **Registry Editor** (RegEdit) as an administrator. |
| 148 | +
|
| 149 | +7. Navigate to **Computer** > **HKEY_LOCAL_MACHINE** > **software** > **FSLogix**, right-click on **FSLogix**, select **New**, and then select **Key**. |
| 150 | +
|
| 151 | +8. Create a new key named **Profiles**. |
| 152 | +
|
| 153 | +9. Right-click on **Profiles**, select **New**, and then select **DWORD (32-bit) Value.** Name the value **Enabled** and set the **Data** value to **1**. |
| 154 | +
|
| 155 | +  |
| 156 | +
|
| 157 | +10. Right-click on **Profiles**, select **New**, and then select **Multi-String Value**. Name the value **VHDLocations** and set enter the URI for the Azure Files share `\\fsprofile.file.core.windows.net\share` as the Data value. |
| 158 | +
|
| 159 | +  |
| 160 | +
|
| 161 | +## Assign users to a session host |
| 162 | +
|
| 163 | +Now you'll need to assign users to your session host. |
| 164 | +
|
| 165 | +To assign users: |
| 166 | +
|
| 167 | +1. Run Windows PowerShell as an administrator, then run the following cmdlet to sign in to Windows Virtual Desktop with PowerShell: |
| 168 | +
|
| 169 | + ```powershell |
| 170 | + Import-Module Microsoft.RdInfra.RdPowershell |
| 171 | +
|
| 172 | + #Optional |
| 173 | + Install-Module Microsoft.RdInfra.RdPowershell |
| 174 | +
|
| 175 | + $brokerurl = "https://rdbroker.wvd.microsoft.com" |
| 176 | +
|
| 177 | + Add-RdsAccount -DeploymentUrl $brokerurl |
| 178 | + ``` |
| 179 | + |
| 180 | + When prompted for credentials, enter the same user that was granted the TenantCreator, RDS Owner, or RDS Contributor role on the Windows Virtual Desktop tenant. |
| 181 | + |
| 182 | +2. Run the following cmdlets to assign the user to the remote desktop group: |
| 183 | + |
| 184 | + ```powershell |
| 185 | + $tenant = "<your-wvd-tenant>" |
| 186 | +
|
| 187 | + $pool1 = "<wvd-pool>" |
| 188 | +
|
| 189 | + $appgroup = "Desktop Application Group" |
| 190 | +
|
| 191 | + $user1 = "<user-principal>" |
| 192 | +
|
| 193 | + Add-RdsAppGroupUser $tenant $pool1 $appgroup $user1 |
| 194 | + ``` |
| 195 | +
|
| 196 | + Like the earlier cmdlets, make sure to replace `<your-wvd-tenant>`, `<wvd-pool>`, and `<user-principal>` with the relevant values. |
| 197 | +
|
| 198 | + For example: |
| 199 | +
|
| 200 | + ```powershell |
| 201 | + $pool1 = "contoso" |
| 202 | + |
| 203 | + $tenant = "contoso" |
| 204 | + |
| 205 | + $appgroup = "Desktop Application Group" |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + Add-RdsAppGroupUser $tenant $pool1 $appgroup $user1 |
| 210 | + ``` |
| 211 | +
|
| 212 | +## Make sure your profile works |
| 213 | +
|
| 214 | +Now all you have to do is make sure the profile you created exists and works as intended. |
| 215 | +
|
| 216 | +To verify your profile: |
| 217 | +
|
| 218 | +1. Open a browser and go to [the Windows Virtual Desktop web client](https://rdweb.wvd.microsoft.com/webclient/index.html). |
| 219 | +
|
| 220 | +2. Sign in with the user account assigned to the Remote Desktop group. |
| 221 | +
|
| 222 | +3. Once the user session has been established, open the Azure portal and sign in with an administrative account. |
| 223 | +
|
| 224 | +4. From the sidebar, select **Storage accounts**. |
| 225 | +
|
| 226 | +5. Select the storage account you configured as the file share for your session host pool and enabled with Azure AD DS. |
| 227 | +
|
| 228 | +6. Select the **Files** icon, then expand your share. |
| 229 | +
|
| 230 | + If everything's set up correctly, you should see a **Directory** with a name that's formatted like this: `<user SID>-<username>`. |
| 231 | +
|
| 232 | +## Next steps |
| 233 | +
|
| 234 | +If you're looking for alternate ways to create FSLogix profile containers, check out the following articles: |
| 235 | +
|
| 236 | +- [Create a profile container for a host pool using a file share](create-host-pools-user-profile.md). |
| 237 | +- [Create an FSLogix profile container for a host pool using Azure NetApp Files](create-fslogix-profile-container.md) |
| 238 | +
|
| 239 | +You can find more detailed information about concepts related to FSlogix containers for Azure files in [FSLogix profile containers and Azure files](fslogix-containers-azure-files.md). |
0 commit comments