This is a method to use Azure Files with Entra ID Joined session hosts for FSLogix. Credit to Tony Cai, Marcel Meurer, and Dave Stephenson. This is largely based on Tony Cai's previous article on the subject with the added benefit of using Nerdio secure variables and powershell secure strings.
In Nerdio:
Create a new Storage Account:
Apply the following settings:
- Storage account: "unique storage account name here"
- Resource Group: "resource group name here"
- Location: "azure region here"
- Performance: Premium
- File Share name: "any name here"
- Provisioned capacity: 100GB minimum
- Keep in mind the default fslogix profile size is set to 10GB per user so plan your capacity accordingly. Also, remember you pay for the size of the storage account and not for the amount of used space so don't oversize either.
- Uncheck "Join to AD", this is because we are using a workaround to access the fileshare since they don't support cloud only identity authentication to azure files
- Don't worry about any other settings, they aren't necessary for this workaround
In Azure:
Find your storage account you just created and open it, then select access keys on the left. You'll see the following screen.
Make sure to note down your storage account name and key by pressing show then copy the key.
Back in Nerdio:
Step 1:
Create a new Scripted Action and set Script Execution Method as "Individual" and name the script "Entra ID Joined Azure Files for FSLgx".
For the script copy the following:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
One caveat with this script, make sure on your base image to install powershell credential manager using the following command: "install-module -name CredentialManager".
I tried bundling this into the same script but was running into issues installing the module on vm creation. If you have luck please post in the comments.
Step 2:
In your host pool properties select FSLogix on the left:
For FSLogix Profiles path enter the path:
- \\[[STORAGEACCOUNTFQDN]\[FILESHARE]
- Ex: \\test01182024.file.core.windows.net\fslogix
Next, add the following registry key:
- AccessNetworkAsComputerObject
- Vaue: 1
You can find this by selecting FSLogix Registry Options, then All Settings and filter it by name.
Now, select VM Deployments on the left side
Set your script to deploy on VM Creation and VM Started. This way the credential is sure to stick in Windows Credential Manager and not expire.
Last part, we need to add the secure variables in Nerdio.
Go to settings inside the account you are using the script on, then select Portal, then add a new variable. Use the following settings:
- Name: FSLgxStorageAccount
- Value: "storage account name you noted down earlier"
- Secure vs Inherited: Secure
- Windows Scripts: "Entra ID Joined Azure Files for FSLgx"
- Azure Runbooks: Deselect "All Scripts"
Add a second variable, and use the following settings:
- Name: FSLgxSecret
- Value: "Storage account access key you noted down earlier"
- Secure vs Inherited: Secure
- Windows Scripts: "Entra ID Joined Azure Files for FSLgx"
- Azure Runbooks: Deselect "All Scripts"
Comments (5 comments)