Repository Breakdown by file
On this page, you’ll find an in-depth breakdown of all the files associated with the WVD QuickStart solution. This is intended for any advanced users who wish to customize the WVD QuickStart for their needs or to do some advanced troubleshooting. The GitHub repository consists of two branches:
- Master branch: All code required by the WVD QuickStart lives here
- gh-pages branch: All files required for the GitHub pages website are located here
The folder structure in the master branch is as follows:
- ARMRunbookScripts: In this folder, a number of custom scripts are located that are run by the ARM deployment, either through an automation runbook or a deployment script.
- /static: In this folder, some PowerShell modules required by the above scripts are located
- Modules/ARM: This folder contains modular ARM templates that are called by the DevOps automation to deploy Azure resources. For every resource, there’s a dedicated deploy.json file, as well as a parameters file, pipeline file, and a testing script. These files are generic and should typically not be modified.
- NewSubAADDSSetup: In this folder, there’s the QuickStart ARM template that is used when you start with an empty subscription.
- QS-WVD: This folder contains many of the files associated with the DevOps pipeline. This folder is also where you’ll do most of your customization. The pipeline.yml file is the main DevOps automation pipeline, and the variables.yml file is where the pipeline gets all its parameters.
- /parameters: This folder is populated in the automation to store ARM deployment parameter files.
- /scripts: This folder contains scripts that are called by the DevOps pipeline.
- /static: This folder contains the important appliedParameters.psd1 file (created in the inital ARM deployment). The parameters in this file are used for the deployment of your WVD resources, and changing the parameters here can be an easy way to customize your WVD deployment.
- /templates/pipelineinput: In here, all the ARM parameter file templates are located, which are populated in the automation based on the parameters in appliedParameters.psd1.
- SharedDeploymentFunctions: This folder contains some scripts called by the DevOps automation pipeline to asssist in the deployment of certain resources.
- Uploads: This folder contains the Custom Script Extensions that are installed on the newly deployed WVD VMs.
- /Scripts: This folder contains the four different custom script extensions that are installed: Azure Files enablement, FSLogix configuration, NotepadPlusPlus, and Microsoft Teams installation.
- Deploy.json: This is the ARM template used for the initial DevOps setup deployment.
- inputValidation.ps1: This script makes sure that the entered Azure Admin credentials are correct, in addition to validating the vnet, subnet, and firewall configuration. This script also configures the ‘WVDServicePrincipal’ managed identity in the deployment resource group to give it the contributor role on the subscription. This is needed to run deployment scripts in the main ARM template successfully.
- AADDSinputValidation.ps1: This script is an adapted version of the script above, and is only used when using the QuickStart starting with an empty subscription.
- createDevopsPipeline.sh: This Azure CLI script creates and starts a DevOps pipeline in the newly created DevOps project.
- createServicePrincipal.ps1: This script creates the AAD application service principal used to create a service connection between the Azure subscription and the DevOps project. If the application already exists, this script will update the existing one with the right permissions.
- devopssetup.ps1: This script makes a number of REST API calls to create a DevOps project, a service connection between the Azure Subscription and the DevOps project, to initialize the DevOps repository with all the required files, to set some permissions in DevOps, and to generate the main automation parameter files: appliedParmeters.psd1 and variables.yml.
- AADDSdevopssetup.ps1: This script is an adapted version of the script above, and is only used when using the QuickStart starting with an empty subscription.
The azuremodules.zip in this folder contains the following PowerShell modules:
- AzureAD If you want to use additional Powershell modules in your runbook scripts, you can add them to this zip folder and adapt the runbookscripts accordingly to install them. The other two zip folder contain static files related to WVD SAAS.
Every module in this folder follows the same folder structure:
- /Parameters: parameters file for the ARM template
- /Pipeline: .yml file that can be used to deploy this resource
- /Scripts: Usually empty, unless custom scripts are needed for the deployment of the resource
- /Tests: Script that validates the ARM template syntax
- deploy.json: ARM template used to deploy this resource
- readme.md: Readme for the specific module
One important module is UserCreation, as this folder contains the script createUsers.ps1 that is used in Native AD deployments to create a new user in on the domain controller through a custom script extension.
This is a crucial folder, as it contains the deployment parameters as well as the DevOps automation files. Directly in the folder you will find the pipeline.yml and variables.template.yml files, which are both further explained here. The remaining subfolders are explained below.
While this folder only holds a Readme.MD file, it is used in the automation to store the WVD ARM deployment parameter files, and it should therefore not be deleted.
This folder contains certain Powershell scripts that are invoked by the DevOps pipeline:
- Invoke-StorageAccountPostDeployment.ps1: This script is used in the deployment of the Assets storage account (see DevOps) to upload the required files for the WVD Virtual Machine Custom Script Extensions.
- New-PipelineParameterSetup.ps1: This script is called at the beginning of the DevOps pipeline (explained here) to generate the parameter files for the deployment of WVD resources.
This folder contains the appliedParameters.template.psd1, which is the template used by the initial ARM deployment to generate the appliedParameters.psd1 file explained here.
This folder contains all the templates for ARM deployment parameter files. These templates are used by the DevOps pipeline as explained here to generate the parameter files for the deployment of WVD resources in the pipeline. The name of the template file indicates what resource it’s used for - I will not go deeper into these here.
- Add-CustomParameters.ps1: This script is called by the pipeline to add additional parameters to a resource deployment, in certain cases; For example, this function is used to add an extra parameter when using Azure AD DS as identity solution to correctly configure the storage account settings.
- Invoke-GeneralDeployment.ps1: This all-important script is called for any resource deployment in the pipeline. This script finds the correct ARM template to deploy that resource, passes the correct parameters as arguments, and starts the ARM deployment.
This folder contains three scripts that are used in the deployment of the Assets storage account (where we store the Custom Script Extension (CSE) files):
- Compress-WVDCSEContent.ps1: This script packages all the CSE files into zip folder to allow for upload to the assets storage account blob.
- Export-WVDCSEContentToBlob.ps1: This script uploads the created zip folders to a blog storage in the assets storage account.
- Import-WVDSoftware.ps1: This script downloads the zip folders onto the VM onto which the CSE is to be installed.
This folder contains the CSEs for the WVD VMs, and it’s named uploads as it will in its entirety be uploaded to the assets storage account. It also contains the ZIP folder Configuration.zip which contains the configuration files for the DSC extension to be installed on the WVD VMs.
Every CSE is run through the cse_run.ps1 file in each subfolder - These scripts are called by the scriptExtensionMasterInstaller.ps1 script. This script unzips the downloaded CSE folders and proceeds to look for cse_run.ps1 files to execute. The other file you will find in this folder is the downloads.parameters.json file. This file contains parameters for certain files that need to be downloaded from the internet to install some of the applications configured in the CSEs. For example, it specifies where to find the FSLogix executable, so that it can be downloaded onto the VM. Let’s now dive into each specific CSE in a little more depth:
- /001-AzFiles: This first custom script extension is used when using a Native AD identity approach (not when using Azure AD DS) to enable Azure Files as explained here. It does so using AzureFilesHybrid, which is used to domain join the storage account. The file structure in this folder is as follows:
- /cse_run.ps1: Main CSE script, which is then used to call the setup.ps1 file in the same folder to domain join the storage account.
- /setup.ps1: Carries out the domain join of the storage account using the AzFilesHybrid module. This script is run in the context of the domain administrator using the PSExec module.
- /AzFilesHybrid.psd1, /AzFilesHybrid.psm1, and /CopyToPSPath.ps1 are all files needed to install or use the AzFilesHybrid module in the setup.ps1 script.
- /PSExec.exe, /PSExec64.exe, /Eula.txt, /Pstools.chm, and /psversion.txt are all files needed for the PSExec module that is used to run the domain join of the storage account in the admin context (rather than the machine context in which CSEs are run by default).
- /cse_run.ps1: Main CSE script that is called to install the FSLogix CSE. From this script, the remaining scripts in this folder are called to configure FSLogix.
- /Install-FSLogix.ps1: This script carries out the initial install of FSLogix using the downloaded executable file.
- /Set-FSLogix.ps1: Configures FSLogix, setting the appropriate registry keys to the right values.
- /Set-NTFSPermissions.ps1: This script is used to configure the permissions on the file share, and to mount the profile drive on the VM using New-PSDrive.
- /cse_run.ps1: Main CSE script that is called to install NotepadPlusPlus using the downloaded executable file.
- /cse_run.ps1: Main CSE script that is called to install Microsoft Teams using the downloaded executable file. This script will also set the Teams registry key required for it to work in a virtualized environment.
This is the ARM template used for the initial deployment, which is explained in a high-level here and in a detailed breakdown here.
Microsoft Support is not handling issues for any published tools in this repository. These tools are published as is with no implied support. However, we would like to welcome you to open issues using GitHub issues to collaborate and improve these tools. You can open an issue here.