Skip to content

brandonh-msft/custom-dev-box

Repository files navigation

Customized Image creation and deployment to Microsoft Dev Box

This repository contains the necessary files & scripts to create a custom image and deploy it to a Microsoft Dev Box.

Contents

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:
    1. Mount a remote Azure File Share as the 'S:' drive on User login
    2. 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.

Deployment files

  • bicepconfig.json - Enables features required for the bicep templates written for deployment
  • common.bicep - types, functions & variables used by the other bicep templates
  • main.bicep - The bicep template which deploys deployment.bicep to a newly-created Resource Group
    deployment.bicep - The template which deploys the Dev Center, Project, Image Template, etc
  • afterimagebuild.bicep - The template which deploys the Dev Box pools which reference the customized build image
  • deploy.ps1 - The script which deploys the bicep templates to Azure
    Requires parameter region denoting one of the supported regions for Microsoft Dev Box

Requirements

Usage

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).

Customizing

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published