This repository contains the necessary files & scripts to create a custom image and deploy it to a Microsoft Dev Box.
1.Setup.ps1
- Applies Timezone redirection settings so local time is redirected to the remote machine
- Applies various Windows Optimizations (see AVD Optimizations repo for more detail)
- Creates a DevDrive VHDX and mounts it to the remote machine (
E:
), redirecting all package caches (npm, maven, nuget, etc.) to the Dev Drive
2.Configure.ps1
- Installs various developer tools system-wide
- Sets up a RunOnce entry in the registry that installs more software upon user's first login
- Sets up 2 scheduled tasks on the remote machine to:
- Mount a remote Azure File Share as the 'S:' drive on User login
- Mount the DevDrive on User login
- Disables 'Reserved Storage' on the VM
The other files in the root are used by the above two scripts. This repo (root only) is cloned to the remote VM at c:\scripts
during the image creation process. If you wish, you can delete it after logging into the Dev Box.
bicepconfig.json
- Enables features required for the bicep templates written for deploymentcommon.bicep
- types, functions & variables used by the other bicep templatesmain.bicep
- The bicep template which deploysdeployment.bicep
to a newly-created Resource Group
deployment.bicep
- The template which deploys the Dev Center, Project, Image Template, etcafterimagebuild.bicep
- The template which deploys the Dev Box pools which reference the customized build imagedeploy.ps1
- The script which deploys the bicep templates to Azure
Requires parameterregion
denoting one of the supported regions for Microsoft Dev Box
- PowerShell (Core or Windows)
- Azure CLI
Too easy! Simply run:
.\deployment\deploy.ps1 [-region] <string> [[-suffix] <string>] [[-subscriptionId] <string>]
where
-region
is one of the supported regions for Microsoft Dev Box
-suffix
is an optional suffix to append to all resources requiring unique names, and
-subscriptionId
is an optional parameter to specify the subscription to deploy to (otherwise the subscription currently targeted by az account show
is used).
Feel free to customize any software installations (machine or user) or Windows configuration by modifying the Install-SystemSoftware.ps1
and Apply-OneTimeUserSetup.ps1
scripts accordingly.
WARNING: Testing your changes takes a really long time; Image Builder Templates take anywhere from 1-4hr to complete.
You can read more about this solution on my blog here.